Re: [PATCH 1/3] make sparse keep its promise about context tracking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +# 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


[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux