Panda3D
Functions
thread.cxx File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

#include "thread.h"
#include "mainThread.h"
#include "externalThread.h"
#include "config_pipeline.h"
#include "mutexDebug.h"
#include "conditionVarDebug.h"
#include "conditionVarFullDebug.h"

Go to the source code of this file.

Functions

 PT (Thread) Thread
 Returns a new Panda Thread object associated with the current thread (which has been created externally). More...
 

Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
drose
Date
2002-08-08

Definition in file thread.cxx.

Function Documentation

◆ PT()

PT ( Thread  )

Returns a new Panda Thread object associated with the current thread (which has been created externally).

This can be used to bind a unique Panda Thread object with an external thread, such as a new Python thread.

It is particularly useful to bind a Panda Thread object to an external thread for the purposes of PStats monitoring. Without this call, each external thread will be assigned the same global ExternalThread object, which means they will all appear in the same PStats graph.

It is the caller's responsibility to save the returned Thread pointer for the lifetime of the external thread. It is an error for the Thread pointer to destruct while the external thread is still in the system.

It is also an error to call this method from the main thread, or twice within a given thread, unless it is given the same name each time (in which case the same pointer will be returned each time).

Definition at line 89 of file thread.cxx.