home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / FSGFX.ZIP / SPWNTHRD.C < prev    next >
C/C++ Source or Header  |  1990-03-07  |  351b  |  18 lines

  1. #include <os2.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <memory.h>
  5. #include <myproc.h> 
  6.  
  7. int spawnthread(int *threadid, void (*fxn)(void))
  8. {
  9.     char *threadstack;
  10.     if((threadstack = malloc(64000)) == NULL)
  11.     {
  12.         printf("Unable to allocate stacks");
  13.         return(2);
  14.     }
  15.     return(DosCreateThread(fxn,threadid,
  16.         threadstack+64001));
  17. }
  18.