In message <005801c02d17$17efc0a0$[EMAIL PROTECTED]>, "Jan Mikk
elsen" writes:
>John Baldwin <[EMAIL PROTECTED]> wrote:
>
>>On 03-Oct-00 Jan Mikkelsen wrote:
>>> There shouldn't be a need for a loop like the one you describe for a
>simple
>>> atomic increment.
>>
>>The trick is that I want to increment and read at the same time.
>
>
>I don't know the exact semantics of atomic_cmpset_int, but it looks like a
>compare and swap operation which returns zero if the operation failed, some
>other value on success.
That is exactly what atomic_cmpset_int is for, look in
sys/fs/devfs/devfs_devs.c
for some examples
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD coreteam member | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message