YYSentinel.m 493 B

12345678910111213141516171819202122232425262728
  1. //
  2. // YYSentinel.m
  3. // YYKit <https://github.com/ibireme/YYKit>
  4. //
  5. // Created by ibireme on 15/4/13.
  6. // Copyright (c) 2015 ibireme.
  7. //
  8. // This source code is licensed under the MIT-style license found in the
  9. // LICENSE file in the root directory of this source tree.
  10. //
  11. #import "YYSentinel.h"
  12. #import <libkern/OSAtomic.h>
  13. @implementation YYSentinel {
  14. int32_t _value;
  15. }
  16. - (int32_t)value {
  17. return _value;
  18. }
  19. - (int32_t)increase {
  20. return OSAtomicIncrement32(&_value);
  21. }
  22. @end