| | 6 | |
| | 7 | Additionally I found this: |
| | 8 | http://www.yqcomputer.com/515_1075_1.htm |
| | 9 | |
| | 10 | |
| | 11 | <quote> |
| | 12 | The usage is: |
| | 13 | BOOL _Pascal NEAR VDHCreateThread(PTID,PFN); |
| | 14 | VOID _Pascal NEAR VDHExitThread(ULONG); |
| | 15 | |
| | 16 | There was a short discussion about VDHCreateThread in OS/2 Device Driver |
| | 17 | Programming at yahoo: |
| | 18 | http://www.yqcomputer.com/ |
| | 19 | |
| | 20 | In my LXAPI32.SYS device driver I've implemented "linux kernel threads" |
| | 21 | with this function. But you have to be carefull. If a thread is started |
| | 22 | by an normal applications request (open, ioctl, etc.) the new created |
| | 23 | thread belongs to the application. It hangs on exit until the thread ends. |
| | 24 | A workaround is to create a "real kernel thread" as a worker thread at |
| | 25 | device driver INIT time. This thread waits for a specific condition (for |
| | 26 | example a semaphore). If a kernel thread should be started at |
| | 27 | applications request it posts the semaphore. Then the worker thread |
| | 28 | starts an other thread. |
| | 29 | LXAPI32.SYS works this way. |
| | 30 | </quote> |