[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Add thread-local storage for POSIX-y platforms.
- Subject: Re: [PATCH] Add thread-local storage for POSIX-y platforms.
- From: Ori Bernstein <ori@xxxxxxxxxxxxxx>
- Reply-to: myrddin-dev@xxxxxxxxxxxxxx
- Date: Sat, 6 Oct 2018 15:31:35 -0700
- To: myrddin-dev@xxxxxxxxxxxxxx
- Cc: iriri <iri@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
On Sat, 06 Oct 2018 14:30:36 -0700, iriri <iri@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> key to be used with `settls(k, v)` and `gettls(k)`. (One concern with
> the latter two functions is that they effectively take and return
> untyped pointers,
Yeah. I think that's acceptable, but I wonder if we can play tricks to
get typed keys.
type tlskey(@a) = int32
const tlsalloc : (-> tlskey(@a))
const tlsget : (k : tlskey(@a)# -> @a#)
It'll still let you get the wrong thing, but at least it adds a veneer
of type safety.
--
Ori Bernstein