mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -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;
|
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
|
// Function: Thread::join
|
||||||
// Access: Public
|
// Access: Public
|
||||||
|
@ -53,6 +53,7 @@ public:
|
|||||||
INLINE const string &get_name() const;
|
INLINE const string &get_name() const;
|
||||||
|
|
||||||
INLINE bool start(ThreadPriority priority, bool global, bool joinable);
|
INLINE bool start(ThreadPriority priority, bool global, bool joinable);
|
||||||
|
INLINE void interrupt();
|
||||||
INLINE void join();
|
INLINE void join();
|
||||||
|
|
||||||
INLINE static void prepare_for_exit();
|
INLINE static void prepare_for_exit();
|
||||||
|
@ -45,6 +45,15 @@ start(ThreadPriority, bool, bool) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: ThreadDummyImpl::interrupt
|
||||||
|
// Access: Public
|
||||||
|
// Description:
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
INLINE void ThreadDummyImpl::
|
||||||
|
interrupt() {
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: ThreadDummyImpl::join
|
// Function: ThreadDummyImpl::join
|
||||||
// Access: Public
|
// Access: Public
|
||||||
|
@ -48,6 +48,7 @@ public:
|
|||||||
INLINE ~ThreadDummyImpl();
|
INLINE ~ThreadDummyImpl();
|
||||||
|
|
||||||
INLINE bool start(ThreadPriority priority, bool global, bool joinable);
|
INLINE bool start(ThreadPriority priority, bool global, bool joinable);
|
||||||
|
INLINE void interrupt();
|
||||||
INLINE void join();
|
INLINE void join();
|
||||||
|
|
||||||
INLINE static void prepare_for_exit();
|
INLINE static void prepare_for_exit();
|
||||||
|
@ -155,6 +155,18 @@ start(ThreadPriority priority, bool global, bool joinable) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: ThreadNsprImpl::interrupt
|
||||||
|
// Access: Public
|
||||||
|
// Description:
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
void ThreadNsprImpl::
|
||||||
|
interrupt() {
|
||||||
|
if (_thread != (PRThread *)NULL) {
|
||||||
|
PR_Interrupt(_thread);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: ThreadNsprImpl::join
|
// Function: ThreadNsprImpl::join
|
||||||
// Access: Public
|
// Access: Public
|
||||||
|
@ -43,6 +43,7 @@ public:
|
|||||||
INLINE ~ThreadNsprImpl();
|
INLINE ~ThreadNsprImpl();
|
||||||
|
|
||||||
bool start(ThreadPriority priority, bool global, bool joinable);
|
bool start(ThreadPriority priority, bool global, bool joinable);
|
||||||
|
void interrupt();
|
||||||
void join();
|
void join();
|
||||||
|
|
||||||
INLINE static void prepare_for_exit();
|
INLINE static void prepare_for_exit();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user