mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 17:35:34 -04:00
add Thread::interrupt
This commit is contained in:
parent
33614fa4ce
commit
13d1f95326
@ -95,6 +95,20 @@ start(ThreadPriority priority, bool global, bool joinable) {
|
||||
return _started;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Thread::interrupt
|
||||
// Access: Public
|
||||
// Description: Sends an interrupt message to the thread. This will
|
||||
// interrupt any blocking-type system calls the thread
|
||||
// may be waiting on, such as I/O, so that the thread
|
||||
// may continue some other processing. The specific
|
||||
// behavior is implementation dependent.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void Thread::
|
||||
interrupt() {
|
||||
_impl.interrupt();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Thread::join
|
||||
// Access: Public
|
||||
|
@ -53,6 +53,7 @@ public:
|
||||
INLINE const string &get_name() const;
|
||||
|
||||
INLINE bool start(ThreadPriority priority, bool global, bool joinable);
|
||||
INLINE void interrupt();
|
||||
INLINE void join();
|
||||
|
||||
INLINE static void prepare_for_exit();
|
||||
|
@ -45,6 +45,15 @@ start(ThreadPriority, bool, bool) {
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: ThreadDummyImpl::interrupt
|
||||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void ThreadDummyImpl::
|
||||
interrupt() {
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: ThreadDummyImpl::join
|
||||
// Access: Public
|
||||
|
@ -48,6 +48,7 @@ public:
|
||||
INLINE ~ThreadDummyImpl();
|
||||
|
||||
INLINE bool start(ThreadPriority priority, bool global, bool joinable);
|
||||
INLINE void interrupt();
|
||||
INLINE void join();
|
||||
|
||||
INLINE static void prepare_for_exit();
|
||||
|
@ -155,6 +155,18 @@ start(ThreadPriority priority, bool global, bool joinable) {
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: ThreadNsprImpl::interrupt
|
||||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void ThreadNsprImpl::
|
||||
interrupt() {
|
||||
if (_thread != (PRThread *)NULL) {
|
||||
PR_Interrupt(_thread);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: ThreadNsprImpl::join
|
||||
// Access: Public
|
||||
|
@ -43,6 +43,7 @@ public:
|
||||
INLINE ~ThreadNsprImpl();
|
||||
|
||||
bool start(ThreadPriority priority, bool global, bool joinable);
|
||||
void interrupt();
|
||||
void join();
|
||||
|
||||
INLINE static void prepare_for_exit();
|
||||
|
Loading…
x
Reference in New Issue
Block a user