[Openal-devel] Thread-local contexts
Jason Daly
jdaly at ist.ucf.edu
Wed Sep 9 16:06:25 PDT 2009
Chris Robinson wrote:
> My current thinking is to have two new functions.
>
> alcMakeThreadCurrent - Sets a thread-specific context, which overrides the
> process-wide context when set to a non-NULL value. If non-NULL,
> alcGetCurrentContext will return this context when called from the
> corresponding thread, otherwise it will return the process-wide context.
>
> alcGetThreadContext - Returns the current thread-specific context, or NULL if
> one is not set. Unlike alcGetCurrentContext, this will not return the
> process-wide context if no thread-specific context is set.
>
Seems reasonable so far. One question...
If you call (in the same thread):
ctx1 = alcCreateContext(...)
ctx2 = alcCreateContext(...)
ctx3 = alcCreateContext(...)
...
alcMakeCurrent(ctx1)
...
alcMakeThreadCurrent(ctx2)
...
alcMakeCurrent(ctx3)
Which context is current now?
--"J"
More information about the Openal-devel
mailing list