Re: [ANNOUNCE] Native POSIX Thread Library 0.1

Luca Barbieri
2002-09-20T10:30:27Z

[-- Attachment #1: Type: text/plain, Size: 504 bytes --]

Great, but how about using code similar to the following rather than
hand-coded asm operations?

extern struct pthread __pt_current_struct asm("%gs:0");
#define __pt_current (&__pt_current_struct)

#define THREAD_GETMEM(descr, member) (__pt_current->member)
#define THREAD_SETMEM(descr, member, value) ((__pt_current->member) =
value)
#define THREAD_MASKMEM(descr, member, mask) ((__pt_current->member) &=
mask)
...

Of course, it doesn't work if you try to take the address of a member.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]