mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-18 12:43:44 -04:00
has_thread() etc.
This commit is contained in:
parent
99e4ecf5db
commit
30c30438d5
@ -135,6 +135,21 @@ save_to_disk() {
|
||||
return do_save_to_disk();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: VertexDataPage::has_thread
|
||||
// Access: Published, Static
|
||||
// Description: Returns true if a thread has been spawned to service
|
||||
// vertex paging requests, or false if it has not (which
|
||||
// may mean either that all paging requests will be
|
||||
// handled by the main thread, or simply that no paging
|
||||
// requests have yet been issued).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool VertexDataPage::
|
||||
has_thread() {
|
||||
MutexHolder holder(_tlock);
|
||||
return !_thread.is_null();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: VertexDataPage::get_page_data
|
||||
// Access: Public
|
||||
|
@ -165,6 +165,8 @@ stop_thread() {
|
||||
}
|
||||
|
||||
if (thread != (PageThread *)NULL) {
|
||||
gobj_cat.info()
|
||||
<< "Stopping vertex paging thread.\n";
|
||||
thread->stop_thread();
|
||||
}
|
||||
}
|
||||
@ -512,6 +514,8 @@ request_ram_class(RamClass ram_class) {
|
||||
MutexHolder holder(_tlock);
|
||||
if (_thread == (PageThread *)NULL) {
|
||||
// Allocate and start a new global thread.
|
||||
gobj_cat.info()
|
||||
<< "Spawning vertex paging thread.\n";
|
||||
_thread = new PageThread;
|
||||
_thread->start(TP_low, true);
|
||||
}
|
||||
|
@ -71,6 +71,8 @@ PUBLISHED:
|
||||
INLINE static VertexDataSaveFile *get_save_file();
|
||||
|
||||
INLINE bool save_to_disk();
|
||||
|
||||
INLINE static bool has_thread();
|
||||
static void stop_thread();
|
||||
|
||||
public:
|
||||
|
Loading…
x
Reference in New Issue
Block a user