two host threads, one OpenGL-context and usage of cudaGLSetGLDevice
===

I am running two host threads that both use textures from one and the same OpenGL-context. I thought that each of the thread has to run cudaGLSetGLDevice at the very first step to:
1. bind device to current thread
2. bind device to currently made OpenGL-context

Note that thread 1 is still working when thread 2 calls cudaGLSetGLDevice. That would include that neither cudaDeviceReset has been calld from thread 1 nor the OpenGL-context has been set to be done afterwards. 

What I get as error output is:

"cannot set while device is active in this process"

What can I do or what am I doing wrong?

My system consists of one NVIDIA GTX 550Ti and I'm using boost::thread.