tech-userlevel archive

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

Re: Moving pthread_(cond|mutex) to libc

Christos Zoulas <> wrote:

> Yes, I don't buy you can't do that. It is convenient for us if you don't
> do that, so we forbid it. We mighrt be able to find a good technical solution
> for this.

Another idea:  let libpthread be dlopen'ed, but abort if
pthread_create() is called after libc mutex or condvar stubs have been

We would introduce a global __threadstubs, initialy set to 0, and set to
1 in stubs from src/lib/libc/thread-stub/thread-stub.c.

Then in pthread_create(), we just need:
        pthread__assert(__threadstubs == 0));

Emmanuel Dreyfus

Home | Main Index | Thread Index | Old Index