> +# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) > +#define try_inc_local() __cond_lock(local, _try_inc_local()) > +static int _try_inc_local(void) > +{ > + if (random() > RAND_MAX/2) { > + local_cnt++; > + return 1; > + } > + return 0; > +} That actually works? I guess it shows that I haven't slept enough while working on this. johannes
Attachment:
signature.asc
Description: This is a digitally signed message part