mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix broken async locking in release build
This commit is contained in:
parent
6cbd1b8bf7
commit
5004f31575
7 changed files with 102 additions and 42 deletions
|
@ -17,23 +17,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef C_ASYNC_EVENTS_H_
|
||||
#define C_ASYNC_EVENTS_H_
|
||||
#ifndef L_ASYNC_EVENTS_H_
|
||||
#define L_ASYNC_EVENTS_H_
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#define _WINSOCKAPI_
|
||||
#include <windows.h>
|
||||
static unsigned sleep(unsigned seconds) {
|
||||
Sleep(seconds * 1000);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
/* Includes */
|
||||
/******************************************************************************/
|
||||
|
@ -93,15 +82,6 @@ public:
|
|||
return worker_thread_wrapper(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* wait for thread to stop
|
||||
*/
|
||||
void Wait() {
|
||||
while(IsRunning()) {
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
* helper function to run a lua script
|
||||
|
@ -237,4 +217,4 @@ private:
|
|||
JSemaphore m_JobQueueCounter;
|
||||
};
|
||||
|
||||
#endif /* C_ASYNC_EVENTS_H_ */
|
||||
#endif /* L_ASYNC_EVENTS_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue