#include "minimap.h"
#include <math.h>
#include "logoutputbuffer.h"
-#include "jthread/jmutexautolock.h"
-#include "jthread/jsemaphore.h"
+#include "threading/mutex_auto_lock.h"
+#include "threading/semaphore.h"
#include "clientmap.h"
#include "settings.h"
#include "nodedef.h"
bool MinimapUpdateThread::pushBlockUpdate(v3s16 pos, MinimapMapblock *data)
{
- JMutexAutoLock lock(m_queue_mutex);
+ MutexAutoLock lock(m_queue_mutex);
// Find if block is already in queue.
// If it is, update the data and quit.
bool MinimapUpdateThread::popBlockUpdate(QueuedMinimapUpdate *update)
{
- JMutexAutoLock lock(m_queue_mutex);
+ MutexAutoLock lock(m_queue_mutex);
if (m_update_queue.empty())
return false;
// Initialize and start thread
m_minimap_update_thread = new MinimapUpdateThread();
m_minimap_update_thread->data = data;
- m_minimap_update_thread->Start();
+ m_minimap_update_thread->start();
}
Mapper::~Mapper()
{
- m_minimap_update_thread->Stop();
- m_minimap_update_thread->Wait();
+ m_minimap_update_thread->stop();
+ m_minimap_update_thread->wait();
m_meshbuffer->drop();
void Mapper::toggleMinimapShape()
{
- JMutexAutoLock lock(m_mutex);
+ MutexAutoLock lock(m_mutex);
data->minimap_shape_round = !data->minimap_shape_round;
g_settings->setBool("minimap_shape_round", data->minimap_shape_round);
if (mode >= MINIMAP_MODE_COUNT)
return;
- JMutexAutoLock lock(m_mutex);
+ MutexAutoLock lock(m_mutex);
data->is_radar = modedefs[mode].is_radar;
data->scan_height = modedefs[mode].scan_height;
bool do_update = false;
{
- JMutexAutoLock lock(m_mutex);
+ MutexAutoLock lock(m_mutex);
if (pos != data->old_pos) {
data->old_pos = data->pos;