mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 07:03:36 -04:00
pstats: Add convenience method for ticking current thread only
This commit is contained in:
parent
aea2d6ef45
commit
cf9574b412
@ -373,6 +373,14 @@ main_tick() {
|
||||
get_global_pstats()->client_main_tick();
|
||||
}
|
||||
|
||||
/**
|
||||
* A convenience function to call new_frame() for the current thread.
|
||||
*/
|
||||
void PStatClient::
|
||||
thread_tick() {
|
||||
get_global_pstats()->client_thread_tick();
|
||||
}
|
||||
|
||||
/**
|
||||
* A convenience function to call new_frame() on any threads with the
|
||||
* indicated sync_name
|
||||
@ -410,6 +418,19 @@ client_main_tick() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A convenience function to call new_frame() on the current thread.
|
||||
*/
|
||||
void PStatClient::
|
||||
client_thread_tick() {
|
||||
ReMutexHolder holder(_lock);
|
||||
|
||||
if (has_impl()) {
|
||||
PStatThread thread = do_get_current_thread();
|
||||
_impl->new_frame(thread.get_index());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A convenience function to call new_frame() on all of the threads with the
|
||||
* indicated sync name.
|
||||
@ -1285,6 +1306,10 @@ void PStatClient::
|
||||
main_tick() {
|
||||
}
|
||||
|
||||
void PStatClient::
|
||||
thread_tick() {
|
||||
}
|
||||
|
||||
void PStatClient::
|
||||
thread_tick(const std::string &) {
|
||||
}
|
||||
@ -1293,6 +1318,10 @@ void PStatClient::
|
||||
client_main_tick() {
|
||||
}
|
||||
|
||||
void PStatClient::
|
||||
client_thread_tick() {
|
||||
}
|
||||
|
||||
void PStatClient::
|
||||
client_thread_tick(const std::string &sync_name) {
|
||||
}
|
||||
|
@ -95,9 +95,11 @@ PUBLISHED:
|
||||
INLINE static void resume_after_pause();
|
||||
|
||||
static void main_tick();
|
||||
static void thread_tick();
|
||||
static void thread_tick(const std::string &sync_name);
|
||||
|
||||
void client_main_tick();
|
||||
void client_thread_tick();
|
||||
void client_thread_tick(const std::string &sync_name);
|
||||
bool client_connect(std::string hostname, int port);
|
||||
void client_disconnect();
|
||||
@ -291,10 +293,12 @@ PUBLISHED:
|
||||
INLINE static void resume_after_pause() { }
|
||||
|
||||
static void main_tick();
|
||||
static void thread_tick();
|
||||
static void thread_tick(const std::string &);
|
||||
|
||||
public:
|
||||
void client_main_tick();
|
||||
void client_thread_tick();
|
||||
void client_thread_tick(const std::string &sync_name);
|
||||
bool client_connect(std::string hostname, int port);
|
||||
void client_disconnect();
|
||||
|
Loading…
x
Reference in New Issue
Block a user