Mercurial > sdl-ios-xcode
comparison src/atomic/dummy/SDL_atomic.c @ 3212:759032c318d8
This is a cosmetic fix, I found a stupid typo
author | Bob Pendleton <bob@pendleton.com> |
---|---|
date | Thu, 02 Jul 2009 21:47:02 +0000 |
parents | 3aa519a5c676 |
children | 48a80f2a7ff2 |
comparison
equal
deleted
inserted
replaced
3211:8c7d86ae6509 | 3212:759032c318d8 |
---|---|
168 SDL_AtomicExchange8(Uint8 * ptr, Uint8 value) | 168 SDL_AtomicExchange8(Uint8 * ptr, Uint8 value) |
169 { | 169 { |
170 #ifdef nativeExchange8 | 170 #ifdef nativeExchange8 |
171 return nativeExchange8(ptr, value); | 171 return nativeExchange8(ptr, value); |
172 #else | 172 #else |
173 Uint8 tmp = 0;; | 173 Uint8 tmp = 0; |
174 | 174 |
175 privateWaitLock(); | 175 privateWaitLock(); |
176 tmp = *ptr; | 176 tmp = *ptr; |
177 *ptr = value; | 177 *ptr = value; |
178 privateUnlock(); | 178 privateUnlock(); |
239 SDL_AtomicFetchThenIncrement8(Uint8 * ptr) | 239 SDL_AtomicFetchThenIncrement8(Uint8 * ptr) |
240 { | 240 { |
241 #ifdef nativeFetchThenIncrement8 | 241 #ifdef nativeFetchThenIncrement8 |
242 return nativeFetchThenIncrement8(ptr); | 242 return nativeFetchThenIncrement8(ptr); |
243 #else | 243 #else |
244 Uint8 tmp = 0;; | 244 Uint8 tmp = 0; |
245 | 245 |
246 privateWaitLock(); | 246 privateWaitLock(); |
247 tmp = *ptr; | 247 tmp = *ptr; |
248 (*ptr)+= 1; | 248 (*ptr)+= 1; |
249 privateUnlock(); | 249 privateUnlock(); |
256 SDL_AtomicFetchThenDecrement8(Uint8 * ptr) | 256 SDL_AtomicFetchThenDecrement8(Uint8 * ptr) |
257 { | 257 { |
258 #ifdef nativeFetchThenDecrement8 | 258 #ifdef nativeFetchThenDecrement8 |
259 return nativeFetchThenDecrement8(ptr); | 259 return nativeFetchThenDecrement8(ptr); |
260 #else | 260 #else |
261 Uint8 tmp = 0;; | 261 Uint8 tmp = 0; |
262 | 262 |
263 privateWaitLock(); | 263 privateWaitLock(); |
264 tmp = *ptr; | 264 tmp = *ptr; |
265 (*ptr) -= 1; | 265 (*ptr) -= 1; |
266 privateUnlock(); | 266 privateUnlock(); |
273 SDL_AtomicFetchThenAdd8(Uint8 * ptr, Uint8 value) | 273 SDL_AtomicFetchThenAdd8(Uint8 * ptr, Uint8 value) |
274 { | 274 { |
275 #ifdef nativeFetchThenAdd8 | 275 #ifdef nativeFetchThenAdd8 |
276 return nativeFetchThenAdd8(ptr, value); | 276 return nativeFetchThenAdd8(ptr, value); |
277 #else | 277 #else |
278 Uint8 tmp = 0;; | 278 Uint8 tmp = 0; |
279 | 279 |
280 privateWaitLock(); | 280 privateWaitLock(); |
281 tmp = *ptr; | 281 tmp = *ptr; |
282 (*ptr)+= value; | 282 (*ptr)+= value; |
283 privateUnlock(); | 283 privateUnlock(); |
290 SDL_AtomicFetchThenSubtract8(Uint8 * ptr, Uint8 value) | 290 SDL_AtomicFetchThenSubtract8(Uint8 * ptr, Uint8 value) |
291 { | 291 { |
292 #ifdef nativeFetchThenSubtract8 | 292 #ifdef nativeFetchThenSubtract8 |
293 return nativeFetchThenSubtract8(ptr, value); | 293 return nativeFetchThenSubtract8(ptr, value); |
294 #else | 294 #else |
295 Uint8 tmp = 0;; | 295 Uint8 tmp = 0; |
296 | 296 |
297 privateWaitLock(); | 297 privateWaitLock(); |
298 tmp = *ptr; | 298 tmp = *ptr; |
299 (*ptr)-= value; | 299 (*ptr)-= value; |
300 privateUnlock(); | 300 privateUnlock(); |
307 SDL_AtomicIncrementThenFetch8(Uint8 * ptr) | 307 SDL_AtomicIncrementThenFetch8(Uint8 * ptr) |
308 { | 308 { |
309 #ifdef nativeIncrementThenFetch8 | 309 #ifdef nativeIncrementThenFetch8 |
310 return nativeIncrementThenFetch8(ptr); | 310 return nativeIncrementThenFetch8(ptr); |
311 #else | 311 #else |
312 Uint8 tmp = 0;; | 312 Uint8 tmp = 0; |
313 | 313 |
314 privateWaitLock(); | 314 privateWaitLock(); |
315 (*ptr)+= 1; | 315 (*ptr)+= 1; |
316 tmp = *ptr; | 316 tmp = *ptr; |
317 privateUnlock(); | 317 privateUnlock(); |
324 SDL_AtomicDecrementThenFetch8(Uint8 * ptr) | 324 SDL_AtomicDecrementThenFetch8(Uint8 * ptr) |
325 { | 325 { |
326 #ifdef nativeDecrementThenFetch8 | 326 #ifdef nativeDecrementThenFetch8 |
327 return nativeDecrementThenFetch8(ptr); | 327 return nativeDecrementThenFetch8(ptr); |
328 #else | 328 #else |
329 Uint8 tmp = 0;; | 329 Uint8 tmp = 0; |
330 | 330 |
331 privateWaitLock(); | 331 privateWaitLock(); |
332 (*ptr)-= 1; | 332 (*ptr)-= 1; |
333 tmp = *ptr; | 333 tmp = *ptr; |
334 privateUnlock(); | 334 privateUnlock(); |
341 SDL_AtomicAddThenFetch8(Uint8 * ptr, Uint8 value) | 341 SDL_AtomicAddThenFetch8(Uint8 * ptr, Uint8 value) |
342 { | 342 { |
343 #ifdef nativeAddThenFetch8 | 343 #ifdef nativeAddThenFetch8 |
344 return nativeAddThenFetch8(ptr, value); | 344 return nativeAddThenFetch8(ptr, value); |
345 #else | 345 #else |
346 Uint8 tmp = 0;; | 346 Uint8 tmp = 0; |
347 | 347 |
348 privateWaitLock(); | 348 privateWaitLock(); |
349 (*ptr)+= value; | 349 (*ptr)+= value; |
350 tmp = *ptr; | 350 tmp = *ptr; |
351 privateUnlock(); | 351 privateUnlock(); |
358 SDL_AtomicSubtractThenFetch8(Uint8 * ptr, Uint8 value) | 358 SDL_AtomicSubtractThenFetch8(Uint8 * ptr, Uint8 value) |
359 { | 359 { |
360 #ifdef nativeSubtractThenFetch8 | 360 #ifdef nativeSubtractThenFetch8 |
361 return nativeSubtractThenFetch8(ptr, value); | 361 return nativeSubtractThenFetch8(ptr, value); |
362 #else | 362 #else |
363 Uint8 tmp = 0;; | 363 Uint8 tmp = 0; |
364 | 364 |
365 privateWaitLock(); | 365 privateWaitLock(); |
366 (*ptr)-= value; | 366 (*ptr)-= value; |
367 tmp = *ptr; | 367 tmp = *ptr; |
368 privateUnlock(); | 368 privateUnlock(); |
377 SDL_AtomicExchange16(Uint16 * ptr, Uint16 value) | 377 SDL_AtomicExchange16(Uint16 * ptr, Uint16 value) |
378 { | 378 { |
379 #ifdef nativeExchange16 | 379 #ifdef nativeExchange16 |
380 return nativeExchange16(ptr, value); | 380 return nativeExchange16(ptr, value); |
381 #else | 381 #else |
382 Uint16 tmp = 0;; | 382 Uint16 tmp = 0; |
383 | 383 |
384 privateWaitLock(); | 384 privateWaitLock(); |
385 tmp = *ptr; | 385 tmp = *ptr; |
386 *ptr = value; | 386 *ptr = value; |
387 privateUnlock(); | 387 privateUnlock(); |
448 SDL_AtomicFetchThenIncrement16(Uint16 * ptr) | 448 SDL_AtomicFetchThenIncrement16(Uint16 * ptr) |
449 { | 449 { |
450 #ifdef nativeFetchThenIncrement16 | 450 #ifdef nativeFetchThenIncrement16 |
451 return nativeFetchThenIncrement16(ptr); | 451 return nativeFetchThenIncrement16(ptr); |
452 #else | 452 #else |
453 Uint16 tmp = 0;; | 453 Uint16 tmp = 0; |
454 | 454 |
455 privateWaitLock(); | 455 privateWaitLock(); |
456 tmp = *ptr; | 456 tmp = *ptr; |
457 (*ptr)+= 1; | 457 (*ptr)+= 1; |
458 privateUnlock(); | 458 privateUnlock(); |
465 SDL_AtomicFetchThenDecrement16(Uint16 * ptr) | 465 SDL_AtomicFetchThenDecrement16(Uint16 * ptr) |
466 { | 466 { |
467 #ifdef nativeFetchThenDecrement16 | 467 #ifdef nativeFetchThenDecrement16 |
468 return nativeFetchThenDecrement16(ptr); | 468 return nativeFetchThenDecrement16(ptr); |
469 #else | 469 #else |
470 Uint16 tmp = 0;; | 470 Uint16 tmp = 0; |
471 | 471 |
472 privateWaitLock(); | 472 privateWaitLock(); |
473 tmp = *ptr; | 473 tmp = *ptr; |
474 (*ptr) -= 1; | 474 (*ptr) -= 1; |
475 privateUnlock(); | 475 privateUnlock(); |
482 SDL_AtomicFetchThenAdd16(Uint16 * ptr, Uint16 value) | 482 SDL_AtomicFetchThenAdd16(Uint16 * ptr, Uint16 value) |
483 { | 483 { |
484 #ifdef nativeFetchThenAdd16 | 484 #ifdef nativeFetchThenAdd16 |
485 return nativeFetchThenAdd16(ptr, value); | 485 return nativeFetchThenAdd16(ptr, value); |
486 #else | 486 #else |
487 Uint16 tmp = 0;; | 487 Uint16 tmp = 0; |
488 | 488 |
489 privateWaitLock(); | 489 privateWaitLock(); |
490 tmp = *ptr; | 490 tmp = *ptr; |
491 (*ptr)+= value; | 491 (*ptr)+= value; |
492 privateUnlock(); | 492 privateUnlock(); |
499 SDL_AtomicFetchThenSubtract16(Uint16 * ptr, Uint16 value) | 499 SDL_AtomicFetchThenSubtract16(Uint16 * ptr, Uint16 value) |
500 { | 500 { |
501 #ifdef nativeFetchThenSubtract16 | 501 #ifdef nativeFetchThenSubtract16 |
502 return nativeFetchThenSubtract16(ptr, value); | 502 return nativeFetchThenSubtract16(ptr, value); |
503 #else | 503 #else |
504 Uint16 tmp = 0;; | 504 Uint16 tmp = 0; |
505 | 505 |
506 privateWaitLock(); | 506 privateWaitLock(); |
507 tmp = *ptr; | 507 tmp = *ptr; |
508 (*ptr)-= value; | 508 (*ptr)-= value; |
509 privateUnlock(); | 509 privateUnlock(); |
516 SDL_AtomicIncrementThenFetch16(Uint16 * ptr) | 516 SDL_AtomicIncrementThenFetch16(Uint16 * ptr) |
517 { | 517 { |
518 #ifdef nativeIncrementThenFetch16 | 518 #ifdef nativeIncrementThenFetch16 |
519 return nativeIncrementThenFetch16(ptr); | 519 return nativeIncrementThenFetch16(ptr); |
520 #else | 520 #else |
521 Uint16 tmp = 0;; | 521 Uint16 tmp = 0; |
522 | 522 |
523 privateWaitLock(); | 523 privateWaitLock(); |
524 (*ptr)+= 1; | 524 (*ptr)+= 1; |
525 tmp = *ptr; | 525 tmp = *ptr; |
526 privateUnlock(); | 526 privateUnlock(); |
533 SDL_AtomicDecrementThenFetch16(Uint16 * ptr) | 533 SDL_AtomicDecrementThenFetch16(Uint16 * ptr) |
534 { | 534 { |
535 #ifdef nativeDecrementThenFetch16 | 535 #ifdef nativeDecrementThenFetch16 |
536 return nativeDecrementThenFetch16(ptr); | 536 return nativeDecrementThenFetch16(ptr); |
537 #else | 537 #else |
538 Uint16 tmp = 0;; | 538 Uint16 tmp = 0; |
539 | 539 |
540 privateWaitLock(); | 540 privateWaitLock(); |
541 (*ptr)-= 1; | 541 (*ptr)-= 1; |
542 tmp = *ptr; | 542 tmp = *ptr; |
543 privateUnlock(); | 543 privateUnlock(); |
550 SDL_AtomicAddThenFetch16(Uint16 * ptr, Uint16 value) | 550 SDL_AtomicAddThenFetch16(Uint16 * ptr, Uint16 value) |
551 { | 551 { |
552 #ifdef nativeAddThenFetch16 | 552 #ifdef nativeAddThenFetch16 |
553 return nativeAddThenFetch16(ptr, value); | 553 return nativeAddThenFetch16(ptr, value); |
554 #else | 554 #else |
555 Uint16 tmp = 0;; | 555 Uint16 tmp = 0; |
556 | 556 |
557 privateWaitLock(); | 557 privateWaitLock(); |
558 (*ptr)+= value; | 558 (*ptr)+= value; |
559 tmp = *ptr; | 559 tmp = *ptr; |
560 privateUnlock(); | 560 privateUnlock(); |
567 SDL_AtomicSubtractThenFetch16(Uint16 * ptr, Uint16 value) | 567 SDL_AtomicSubtractThenFetch16(Uint16 * ptr, Uint16 value) |
568 { | 568 { |
569 #ifdef nativeSubtractThenFetch16 | 569 #ifdef nativeSubtractThenFetch16 |
570 return nativeSubtractThenFetch16(ptr, value); | 570 return nativeSubtractThenFetch16(ptr, value); |
571 #else | 571 #else |
572 Uint16 tmp = 0;; | 572 Uint16 tmp = 0; |
573 | 573 |
574 privateWaitLock(); | 574 privateWaitLock(); |
575 (*ptr)-= value; | 575 (*ptr)-= value; |
576 tmp = *ptr; | 576 tmp = *ptr; |
577 privateUnlock(); | 577 privateUnlock(); |
586 SDL_AtomicExchange32(Uint32 * ptr, Uint32 value) | 586 SDL_AtomicExchange32(Uint32 * ptr, Uint32 value) |
587 { | 587 { |
588 #ifdef nativeExchange32 | 588 #ifdef nativeExchange32 |
589 return nativeExchange32(ptr, value); | 589 return nativeExchange32(ptr, value); |
590 #else | 590 #else |
591 Uint32 tmp = 0;; | 591 Uint32 tmp = 0; |
592 | 592 |
593 privateWaitLock(); | 593 privateWaitLock(); |
594 tmp = *ptr; | 594 tmp = *ptr; |
595 *ptr = value; | 595 *ptr = value; |
596 privateUnlock(); | 596 privateUnlock(); |
657 SDL_AtomicFetchThenIncrement32(Uint32 * ptr) | 657 SDL_AtomicFetchThenIncrement32(Uint32 * ptr) |
658 { | 658 { |
659 #ifdef nativeFetchThenIncrement32 | 659 #ifdef nativeFetchThenIncrement32 |
660 return nativeFetchThenIncrement32(ptr); | 660 return nativeFetchThenIncrement32(ptr); |
661 #else | 661 #else |
662 Uint32 tmp = 0;; | 662 Uint32 tmp = 0; |
663 | 663 |
664 privateWaitLock(); | 664 privateWaitLock(); |
665 tmp = *ptr; | 665 tmp = *ptr; |
666 (*ptr)+= 1; | 666 (*ptr)+= 1; |
667 privateUnlock(); | 667 privateUnlock(); |
674 SDL_AtomicFetchThenDecrement32(Uint32 * ptr) | 674 SDL_AtomicFetchThenDecrement32(Uint32 * ptr) |
675 { | 675 { |
676 #ifdef nativeFetchThenDecrement32 | 676 #ifdef nativeFetchThenDecrement32 |
677 return nativeFetchThenDecrement32(ptr); | 677 return nativeFetchThenDecrement32(ptr); |
678 #else | 678 #else |
679 Uint32 tmp = 0;; | 679 Uint32 tmp = 0; |
680 | 680 |
681 privateWaitLock(); | 681 privateWaitLock(); |
682 tmp = *ptr; | 682 tmp = *ptr; |
683 (*ptr) -= 1; | 683 (*ptr) -= 1; |
684 privateUnlock(); | 684 privateUnlock(); |
691 SDL_AtomicFetchThenAdd32(Uint32 * ptr, Uint32 value) | 691 SDL_AtomicFetchThenAdd32(Uint32 * ptr, Uint32 value) |
692 { | 692 { |
693 #ifdef nativeFetchThenAdd32 | 693 #ifdef nativeFetchThenAdd32 |
694 return nativeFetchThenAdd32(ptr, value); | 694 return nativeFetchThenAdd32(ptr, value); |
695 #else | 695 #else |
696 Uint32 tmp = 0;; | 696 Uint32 tmp = 0; |
697 | 697 |
698 privateWaitLock(); | 698 privateWaitLock(); |
699 tmp = *ptr; | 699 tmp = *ptr; |
700 (*ptr)+= value; | 700 (*ptr)+= value; |
701 privateUnlock(); | 701 privateUnlock(); |
708 SDL_AtomicFetchThenSubtract32(Uint32 * ptr, Uint32 value) | 708 SDL_AtomicFetchThenSubtract32(Uint32 * ptr, Uint32 value) |
709 { | 709 { |
710 #ifdef nativeFetchThenSubtract32 | 710 #ifdef nativeFetchThenSubtract32 |
711 return nativeFetchThenSubtract32(ptr, value); | 711 return nativeFetchThenSubtract32(ptr, value); |
712 #else | 712 #else |
713 Uint32 tmp = 0;; | 713 Uint32 tmp = 0; |
714 | 714 |
715 privateWaitLock(); | 715 privateWaitLock(); |
716 tmp = *ptr; | 716 tmp = *ptr; |
717 (*ptr)-= value; | 717 (*ptr)-= value; |
718 privateUnlock(); | 718 privateUnlock(); |
725 SDL_AtomicIncrementThenFetch32(Uint32 * ptr) | 725 SDL_AtomicIncrementThenFetch32(Uint32 * ptr) |
726 { | 726 { |
727 #ifdef nativeIncrementThenFetch32 | 727 #ifdef nativeIncrementThenFetch32 |
728 return nativeIncrementThenFetch32(ptr); | 728 return nativeIncrementThenFetch32(ptr); |
729 #else | 729 #else |
730 Uint32 tmp = 0;; | 730 Uint32 tmp = 0; |
731 | 731 |
732 privateWaitLock(); | 732 privateWaitLock(); |
733 (*ptr)+= 1; | 733 (*ptr)+= 1; |
734 tmp = *ptr; | 734 tmp = *ptr; |
735 privateUnlock(); | 735 privateUnlock(); |
742 SDL_AtomicDecrementThenFetch32(Uint32 * ptr) | 742 SDL_AtomicDecrementThenFetch32(Uint32 * ptr) |
743 { | 743 { |
744 #ifdef nativeDecrementThenFetch32 | 744 #ifdef nativeDecrementThenFetch32 |
745 return nativeDecrementThenFetch32(ptr); | 745 return nativeDecrementThenFetch32(ptr); |
746 #else | 746 #else |
747 Uint32 tmp = 0;; | 747 Uint32 tmp = 0; |
748 | 748 |
749 privateWaitLock(); | 749 privateWaitLock(); |
750 (*ptr)-= 1; | 750 (*ptr)-= 1; |
751 tmp = *ptr; | 751 tmp = *ptr; |
752 privateUnlock(); | 752 privateUnlock(); |
759 SDL_AtomicAddThenFetch32(Uint32 * ptr, Uint32 value) | 759 SDL_AtomicAddThenFetch32(Uint32 * ptr, Uint32 value) |
760 { | 760 { |
761 #ifdef nativeAddThenFetch32 | 761 #ifdef nativeAddThenFetch32 |
762 return nativeAddThenFetch32(ptr, value); | 762 return nativeAddThenFetch32(ptr, value); |
763 #else | 763 #else |
764 Uint32 tmp = 0;; | 764 Uint32 tmp = 0; |
765 | 765 |
766 privateWaitLock(); | 766 privateWaitLock(); |
767 (*ptr)+= value; | 767 (*ptr)+= value; |
768 tmp = *ptr; | 768 tmp = *ptr; |
769 privateUnlock(); | 769 privateUnlock(); |
776 SDL_AtomicSubtractThenFetch32(Uint32 * ptr, Uint32 value) | 776 SDL_AtomicSubtractThenFetch32(Uint32 * ptr, Uint32 value) |
777 { | 777 { |
778 #ifdef nativeSubtractThenFetch32 | 778 #ifdef nativeSubtractThenFetch32 |
779 return nativeSubtractThenFetch32(ptr, value); | 779 return nativeSubtractThenFetch32(ptr, value); |
780 #else | 780 #else |
781 Uint32 tmp = 0;; | 781 Uint32 tmp = 0; |
782 | 782 |
783 privateWaitLock(); | 783 privateWaitLock(); |
784 (*ptr)-= value; | 784 (*ptr)-= value; |
785 tmp = *ptr; | 785 tmp = *ptr; |
786 privateUnlock(); | 786 privateUnlock(); |
796 SDL_AtomicExchange64(Uint64 * ptr, Uint64 value) | 796 SDL_AtomicExchange64(Uint64 * ptr, Uint64 value) |
797 { | 797 { |
798 #ifdef nativeExchange64 | 798 #ifdef nativeExchange64 |
799 return nativeExchange64(ptr, value); | 799 return nativeExchange64(ptr, value); |
800 #else | 800 #else |
801 Uint64 tmp = 0;; | 801 Uint64 tmp = 0; |
802 | 802 |
803 privateWaitLock(); | 803 privateWaitLock(); |
804 tmp = *ptr; | 804 tmp = *ptr; |
805 *ptr = value; | 805 *ptr = value; |
806 privateUnlock(); | 806 privateUnlock(); |
867 SDL_AtomicFetchThenIncrement64(Uint64 * ptr) | 867 SDL_AtomicFetchThenIncrement64(Uint64 * ptr) |
868 { | 868 { |
869 #ifdef nativeFetchThenIncrement64 | 869 #ifdef nativeFetchThenIncrement64 |
870 return nativeFetchThenIncrement64(ptr); | 870 return nativeFetchThenIncrement64(ptr); |
871 #else | 871 #else |
872 Uint64 tmp = 0;; | 872 Uint64 tmp = 0; |
873 | 873 |
874 privateWaitLock(); | 874 privateWaitLock(); |
875 tmp = *ptr; | 875 tmp = *ptr; |
876 (*ptr)+= 1; | 876 (*ptr)+= 1; |
877 privateUnlock(); | 877 privateUnlock(); |
884 SDL_AtomicFetchThenDecrement64(Uint64 * ptr) | 884 SDL_AtomicFetchThenDecrement64(Uint64 * ptr) |
885 { | 885 { |
886 #ifdef nativeFetchThenDecrement64 | 886 #ifdef nativeFetchThenDecrement64 |
887 return nativeFetchThenDecrement64(ptr); | 887 return nativeFetchThenDecrement64(ptr); |
888 #else | 888 #else |
889 Uint64 tmp = 0;; | 889 Uint64 tmp = 0; |
890 | 890 |
891 privateWaitLock(); | 891 privateWaitLock(); |
892 tmp = *ptr; | 892 tmp = *ptr; |
893 (*ptr) -= 1; | 893 (*ptr) -= 1; |
894 privateUnlock(); | 894 privateUnlock(); |
901 SDL_AtomicFetchThenAdd64(Uint64 * ptr, Uint64 value) | 901 SDL_AtomicFetchThenAdd64(Uint64 * ptr, Uint64 value) |
902 { | 902 { |
903 #ifdef nativeFetchThenAdd64 | 903 #ifdef nativeFetchThenAdd64 |
904 return nativeFetchThenAdd64(ptr, value); | 904 return nativeFetchThenAdd64(ptr, value); |
905 #else | 905 #else |
906 Uint64 tmp = 0;; | 906 Uint64 tmp = 0; |
907 | 907 |
908 privateWaitLock(); | 908 privateWaitLock(); |
909 tmp = *ptr; | 909 tmp = *ptr; |
910 (*ptr)+= value; | 910 (*ptr)+= value; |
911 privateUnlock(); | 911 privateUnlock(); |
918 SDL_AtomicFetchThenSubtract64(Uint64 * ptr, Uint64 value) | 918 SDL_AtomicFetchThenSubtract64(Uint64 * ptr, Uint64 value) |
919 { | 919 { |
920 #ifdef nativeFetchThenSubtract64 | 920 #ifdef nativeFetchThenSubtract64 |
921 return nativeFetchThenSubtract64(ptr, value); | 921 return nativeFetchThenSubtract64(ptr, value); |
922 #else | 922 #else |
923 Uint64 tmp = 0;; | 923 Uint64 tmp = 0; |
924 | 924 |
925 privateWaitLock(); | 925 privateWaitLock(); |
926 tmp = *ptr; | 926 tmp = *ptr; |
927 (*ptr)-= value; | 927 (*ptr)-= value; |
928 privateUnlock(); | 928 privateUnlock(); |
935 SDL_AtomicIncrementThenFetch64(Uint64 * ptr) | 935 SDL_AtomicIncrementThenFetch64(Uint64 * ptr) |
936 { | 936 { |
937 #ifdef nativeIncrementThenFetch64 | 937 #ifdef nativeIncrementThenFetch64 |
938 return nativeIncrementThenFetch64(ptr); | 938 return nativeIncrementThenFetch64(ptr); |
939 #else | 939 #else |
940 Uint64 tmp = 0;; | 940 Uint64 tmp = 0; |
941 | 941 |
942 privateWaitLock(); | 942 privateWaitLock(); |
943 (*ptr)+= 1; | 943 (*ptr)+= 1; |
944 tmp = *ptr; | 944 tmp = *ptr; |
945 privateUnlock(); | 945 privateUnlock(); |
952 SDL_AtomicDecrementThenFetch64(Uint64 * ptr) | 952 SDL_AtomicDecrementThenFetch64(Uint64 * ptr) |
953 { | 953 { |
954 #ifdef nativeDecrementThenFetch64 | 954 #ifdef nativeDecrementThenFetch64 |
955 return nativeDecrementThenFetch64(ptr); | 955 return nativeDecrementThenFetch64(ptr); |
956 #else | 956 #else |
957 Uint64 tmp = 0;; | 957 Uint64 tmp = 0; |
958 | 958 |
959 privateWaitLock(); | 959 privateWaitLock(); |
960 (*ptr)-= 1; | 960 (*ptr)-= 1; |
961 tmp = *ptr; | 961 tmp = *ptr; |
962 privateUnlock(); | 962 privateUnlock(); |
969 SDL_AtomicAddThenFetch64(Uint64 * ptr, Uint64 value) | 969 SDL_AtomicAddThenFetch64(Uint64 * ptr, Uint64 value) |
970 { | 970 { |
971 #ifdef nativeAddThenFetch64 | 971 #ifdef nativeAddThenFetch64 |
972 return nativeAddThenFetch64(ptr, value); | 972 return nativeAddThenFetch64(ptr, value); |
973 #else | 973 #else |
974 Uint64 tmp = 0;; | 974 Uint64 tmp = 0; |
975 | 975 |
976 privateWaitLock(); | 976 privateWaitLock(); |
977 (*ptr)+= value; | 977 (*ptr)+= value; |
978 tmp = *ptr; | 978 tmp = *ptr; |
979 privateUnlock(); | 979 privateUnlock(); |
986 SDL_AtomicSubtractThenFetch64(Uint64 * ptr, Uint64 value) | 986 SDL_AtomicSubtractThenFetch64(Uint64 * ptr, Uint64 value) |
987 { | 987 { |
988 #ifdef nativeSubtractThenFetch64 | 988 #ifdef nativeSubtractThenFetch64 |
989 return nativeSubtractThenFetch64(ptr, value); | 989 return nativeSubtractThenFetch64(ptr, value); |
990 #else | 990 #else |
991 Uint64 tmp = 0;; | 991 Uint64 tmp = 0; |
992 | 992 |
993 privateWaitLock(); | 993 privateWaitLock(); |
994 (*ptr)-= value; | 994 (*ptr)-= value; |
995 tmp = *ptr; | 995 tmp = *ptr; |
996 privateUnlock(); | 996 privateUnlock(); |