-
August 17th, 2009, 01:03 AM
#1
Question about atomic_cas_ptr
Hi,
I am using atomic_cas_ptr from atomic.h provided by solaris 10 for one of my implementations to do an atomic compare and swap. This function atomic_cas_ptr always returns the old value stored in the target. I was wondering if there is any way we can get a boolean true or false to know whether the CAS succeeded in one atomic function call rather than having to check the value of target after calling atomic_cas_ptr.
Thanks a lot.
-
August 17th, 2009, 09:19 AM
#2
Re: Question about atomic_cas_ptr
>> rather than having to check the value of target
??
http://docs.sun.com/app/docs/doc/816...-ptr-9f?a=view
The old value of the 'target', "at the time of the call", is returned so you can compare it with 'cmp'. If equal then you know that 'newval' was assigned to 'target' ("at the time of the call").
gg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|