Minetest  5.4.0
EmergeThread Class Reference
+ Inheritance diagram for EmergeThread:
+ Collaboration diagram for EmergeThread:

Public Member Functions

 EmergeThread (Server *server, int ethreadid)
 
 ~EmergeThread ()=default
 
void * run ()
 
void signal ()
 
bool pushBlock (const v3s16 &pos)
 
void cancelPendingItems ()
 
- Public Member Functions inherited from Thread
 Thread (const std::string &name="")
 
virtual ~Thread ()
 
bool start ()
 
bool stop ()
 
bool wait ()
 
bool isCurrentThread ()
 
bool isRunning ()
 
bool stopRequested ()
 
std::thread::id getThreadId ()
 
bool getReturnValue (void **ret)
 
bool bindToProcessor (unsigned int proc_number)
 
bool setPriority (int prio)
 

Static Public Member Functions

static void runCompletionCallbacks (const v3s16 &pos, EmergeAction action, const EmergeCallbackList &callbacks)
 
- Static Public Member Functions inherited from Thread
static void setName (const std::string &name)
 
static unsigned int getNumberOfProcessors ()
 

Public Attributes

bool enable_mapgen_debug_info
 
int id
 

Private Member Functions

bool popBlockEmerge (v3s16 *pos, BlockEmergeData *bedata)
 
EmergeAction getBlockOrStartGen (const v3s16 &pos, bool allow_gen, MapBlock **block, BlockMakeData *data)
 
MapBlockfinishGen (v3s16 pos, BlockMakeData *bmdata, std::map< v3s16, MapBlock * > *modified_blocks)
 

Private Attributes

Serverm_server
 
ServerMapm_map
 
EmergeManagerm_emerge
 
Mapgenm_mapgen
 
Event m_queue_event
 
std::queue< v3s16m_block_queue
 

Friends

class EmergeManager
 

Additional Inherited Members

- Protected Attributes inherited from Thread
std::string m_name
 

Constructor & Destructor Documentation

◆ EmergeThread()

EmergeThread::EmergeThread ( Server server,
int  ethreadid 
)

References itos(), and Thread::m_name.

+ Here is the call graph for this function:

◆ ~EmergeThread()

EmergeThread::~EmergeThread ( )
default

Member Function Documentation

◆ cancelPendingItems()

void EmergeThread::cancelPendingItems ( )

References BlockEmergeData::callbacks, EMERGE_CANCELLED, m_block_queue, m_emerge, EmergeManager::m_queue_mutex, EmergeManager::popBlockEmergeData(), and runCompletionCallbacks().

+ Here is the call graph for this function:

◆ finishGen()

MapBlock * EmergeThread::finishGen ( v3s16  pos,
BlockMakeData bmdata,
std::map< v3s16, MapBlock * > *  modified_blocks 
)
private

References ServerEnvironment::activateBlock(), analyze_block(), BlockMakeData::blockpos_max, BlockMakeData::blockpos_min, Mapgen::blockseed, GenerateNotifier::clearEvents(), EMERGE_DBG_OUT, ScriptApiEnv::environment_OnGenerated(), errorstream, ServerMap::finishBlockMake(), g_profiler, Mapgen::gennotify, Map::getBlockNoCreateNoEx(), Server::getScriptIface(), Server::m_env, Server::m_env_mutex, Server::m_ignore_map_edit_events_area, m_map, m_mapgen, m_server, MAP_BLOCKSIZE, PP, Server::setAsyncFatalError(), SPT_AVG, and BaseException::what().

Referenced by run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBlockOrStartGen()

EmergeAction EmergeThread::getBlockOrStartGen ( const v3s16 pos,
bool  allow_gen,
MapBlock **  block,
BlockMakeData data 
)
private

References EMERGE_CANCELLED, EMERGE_FROM_DISK, EMERGE_FROM_MEMORY, EMERGE_GENERATED, Map::getBlockNoCreateNoEx(), ServerMap::initBlockMake(), MapBlock::isDummy(), MapBlock::isGenerated(), ServerMap::loadBlock(), Server::m_env_mutex, m_map, and m_server.

Referenced by run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ popBlockEmerge()

bool EmergeThread::popBlockEmerge ( v3s16 pos,
BlockEmergeData bedata 
)
private

References m_block_queue, m_emerge, EmergeManager::m_queue_mutex, and EmergeManager::popBlockEmergeData().

Referenced by run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pushBlock()

bool EmergeThread::pushBlock ( const v3s16 pos)

References m_block_queue.

Referenced by EmergeManager::enqueueBlockEmergeEx().

+ Here is the caller graph for this function:

◆ run()

◆ runCompletionCallbacks()

void EmergeThread::runCompletionCallbacks ( const v3s16 pos,
EmergeAction  action,
const EmergeCallbackList callbacks 
)
static

Referenced by cancelPendingItems(), and run().

+ Here is the caller graph for this function:

◆ signal()

void EmergeThread::signal ( )

References m_queue_event, and Event::signal().

Referenced by EmergeManager::~EmergeManager(), and EmergeManager::enqueueBlockEmergeEx().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ EmergeManager

friend class EmergeManager
friend

Member Data Documentation

◆ enable_mapgen_debug_info

bool EmergeThread::enable_mapgen_debug_info

Referenced by run().

◆ id

int EmergeThread::id

Referenced by run().

◆ m_block_queue

std::queue<v3s16> EmergeThread::m_block_queue
private

◆ m_emerge

EmergeManager* EmergeThread::m_emerge
private

◆ m_map

ServerMap* EmergeThread::m_map
private

Referenced by finishGen(), getBlockOrStartGen(), and run().

◆ m_mapgen

Mapgen* EmergeThread::m_mapgen
private

◆ m_queue_event

Event EmergeThread::m_queue_event
private

Referenced by run(), and signal().

◆ m_server

Server* EmergeThread::m_server
private

Referenced by finishGen(), getBlockOrStartGen(), and run().


The documentation for this class was generated from the following file: