diff options
author | ShadowNinja <shadowninja@minetest.net> | 2015-04-07 06:13:12 -0400 |
---|---|---|
committer | ShadowNinja <shadowninja@minetest.net> | 2015-08-23 22:04:06 -0400 |
commit | e4bff8be94c0db4f94e63ad448d0eeb869ccdbbd (patch) | |
tree | 7935586e79da5c8c7144e345a8c0fc1cda53beed /src/particles.cpp | |
parent | 6a1047d8c116f793890b63427d53f04ceca95d54 (diff) | |
download | minetest-e4bff8be94c0db4f94e63ad448d0eeb869ccdbbd.tar.gz minetest-e4bff8be94c0db4f94e63ad448d0eeb869ccdbbd.tar.bz2 minetest-e4bff8be94c0db4f94e63ad448d0eeb869ccdbbd.zip |
Clean up threading
* Rename everything.
* Strip J prefix.
* Change UpperCamelCase functions to lowerCamelCase.
* Remove global (!) semaphore count mutex on OSX.
* Remove semaphore count getter (unused, unsafe, depended on internal
API functions on Windows, and used a hack on OSX).
* Add `Atomic<type>`.
* Make `Thread` handle thread names.
* Add support for C++11 multi-threading.
* Combine pthread and win32 sources.
* Remove `ThreadStarted` (unused, unneeded).
* Move some includes from the headers to the sources.
* Move all of `Event` into its header (allows inlining with no new includes).
* Make `Event` use `Semaphore` (except on Windows).
* Move some porting functions into `Thread`.
* Integrate logging with `Thread`.
* Add threading test.
Diffstat (limited to 'src/particles.cpp')
-rw-r--r-- | src/particles.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/particles.cpp b/src/particles.cpp index 15e2a6597..ab48bae9e 100644 --- a/src/particles.cpp +++ b/src/particles.cpp @@ -347,7 +347,7 @@ void ParticleManager::step(float dtime) void ParticleManager::stepSpawners (float dtime) { - JMutexAutoLock lock(m_spawner_list_lock); + MutexAutoLock lock(m_spawner_list_lock); for(std::map<u32, ParticleSpawner*>::iterator i = m_particle_spawners.begin(); i != m_particle_spawners.end();) @@ -367,7 +367,7 @@ void ParticleManager::stepSpawners (float dtime) void ParticleManager::stepParticles (float dtime) { - JMutexAutoLock lock(m_particle_list_lock); + MutexAutoLock lock(m_particle_list_lock); for(std::vector<Particle*>::iterator i = m_particles.begin(); i != m_particles.end();) { @@ -387,8 +387,8 @@ void ParticleManager::stepParticles (float dtime) void ParticleManager::clearAll () { - JMutexAutoLock lock(m_spawner_list_lock); - JMutexAutoLock lock2(m_particle_list_lock); + MutexAutoLock lock(m_spawner_list_lock); + MutexAutoLock lock2(m_particle_list_lock); for(std::map<u32, ParticleSpawner*>::iterator i = m_particle_spawners.begin(); i != m_particle_spawners.end();) @@ -411,7 +411,7 @@ void ParticleManager::handleParticleEvent(ClientEvent *event, IGameDef *gamedef, scene::ISceneManager* smgr, LocalPlayer *player) { if (event->type == CE_DELETE_PARTICLESPAWNER) { - JMutexAutoLock lock(m_spawner_list_lock); + MutexAutoLock lock(m_spawner_list_lock); if (m_particle_spawners.find(event->delete_particlespawner.id) != m_particle_spawners.end()) { @@ -425,7 +425,7 @@ void ParticleManager::handleParticleEvent(ClientEvent *event, IGameDef *gamedef, if (event->type == CE_ADD_PARTICLESPAWNER) { { - JMutexAutoLock lock(m_spawner_list_lock); + MutexAutoLock lock(m_spawner_list_lock); if (m_particle_spawners.find(event->add_particlespawner.id) != m_particle_spawners.end()) { @@ -465,7 +465,7 @@ void ParticleManager::handleParticleEvent(ClientEvent *event, IGameDef *gamedef, delete event->add_particlespawner.maxacc; { - JMutexAutoLock lock(m_spawner_list_lock); + MutexAutoLock lock(m_spawner_list_lock); m_particle_spawners.insert( std::pair<u32, ParticleSpawner*>( event->add_particlespawner.id, @@ -568,6 +568,6 @@ void ParticleManager::addNodeParticle(IGameDef* gamedef, scene::ISceneManager* s void ParticleManager::addParticle(Particle* toadd) { - JMutexAutoLock lock(m_particle_list_lock); + MutexAutoLock lock(m_particle_list_lock); m_particles.push_back(toadd); } |