atomic:

if (num_pinned == 0 && ptr != 0)
{
    swap(ptr, 0);
}

struct {
    void *ptr;
    Intptr num_pinned;
};

p = ptr
if (p != NULL)
{
    e = [p 0x00000000]
    result = [NULL 0x00000000]
    if (CAS(&ptr, e, result))
    {
        free(result.high);
    }
}

相关文章: