You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.3 KiB

  1. /*****************************************************************************
  2. Copyright (c) 2009, Innobase Oy. All Rights Reserved.
  3. This program is free software; you can redistribute it and/or modify it under
  4. the terms of the GNU General Public License as published by the Free Software
  5. Foundation; version 2 of the License.
  6. This program is distributed in the hope that it will be useful, but WITHOUT
  7. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License along with
  10. this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  11. Place, Suite 330, Boston, MA 02111-1307 USA
  12. *****************************************************************************/
  13. /*****************************************************************************
  14. If this program compiles, then Solaris libc atomic funcions are available.
  15. Created April 18, 2009 Vasil Dimov
  16. *****************************************************************************/
  17. #include <atomic.h>
  18. int
  19. main(int argc, char** argv)
  20. {
  21. ulong_t ulong = 0;
  22. uint32_t uint32 = 0;
  23. uint64_t uint64 = 0;
  24. atomic_cas_ulong(&ulong, 0, 1);
  25. atomic_cas_32(&uint32, 0, 1);
  26. atomic_cas_64(&uint64, 0, 1);
  27. atomic_add_long(&ulong, 0);
  28. return(0);
  29. }