码迷,mamicode.com
首页 > Windows程序 > 详细

Linux下原子性操作,类似Windows下的InterLockedXXX

时间:2015-06-23 19:40:12      阅读:231      评论:0      收藏:0      [点我收藏+]

标签:

 

type __sync_fetch_and_add (type *ptr, type value);
type __sync_fetch_and_sub (type *ptr, type value);
type __sync_fetch_and_or (type *ptr, type value);
type __sync_fetch_and_and (type *ptr, type value);
type __sync_fetch_and_xor (type *ptr, type value);
type __sync_fetch_and_nand (type *ptr, type value);
type __sync_add_and_fetch (type *ptr, type value);
type __sync_sub_and_fetch (type *ptr, type value);
type __sync_or_and_fetch (type *ptr, type value);
type __sync_and_and_fetch (type *ptr, type value);
type __sync_xor_and_fetch (type *ptr, type value);
type __sync_nand_and_fetch (type *ptr, type value);

参考:

《Multithreaded simple data type access and atomic variables》

Linux下原子性操作,类似Windows下的InterLockedXXX

标签:

原文地址:http://www.cnblogs.com/wanliyun/p/4595826.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!