Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PThread * PThread::Create ( const PNotifier notifier,
INT  parameter = 0,
AutoDeleteFlag  deletion = AutoDeleteThread,
Priority  priorityLevel = NormalPriority,
const PString threadName = PString::Empty(),
PINDEX  stackSize = 10000 
) [static, inherited]

Create a simple thread executing the specified notifier. This creates a simple PThread class that automatically executes the function defined by the PNotifier in the context of a new thread.

notifierFunction to execute in thread.
parameterParameter value to pass to notifier.
deletionAutomatically delete PThread instance on termination of thread.
priorityLevelInitial priority of thread.
threadNameThe name of the thread (for Debug/Trace)
stackSizeStack size on some platforms

Definition at line 2160 of file osutils.cxx.

References PThread::AutoDeleteThread.

Referenced by Vxmltest::Main(), VidTest::Main(), LauncherThread::Main(), PVideoOutputDevice_Window::Open(), and PVideoInputDevice_VideoForWindows::Open().

  PThread * thread = new PSimpleThread(notifier,
  if (deletion != AutoDeleteThread)
    return thread;

  // Do not return a pointer to the thread if it is auto-delete as this
  // pointer is extremely dangerous to use, it could be deleted at any moment
  // from now on so using the pointer could crash the program.
  return NULL;

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index