1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00

Use Thread c'tor to properly init the struct

This is what c'tors are for.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2010-02-13 11:40:55 +01:00
parent 6382324afd
commit 093dd8fe88
2 changed files with 5 additions and 8 deletions

View file

@ -566,9 +566,6 @@ void init_threads() {
pthread_t pthread[1];
#endif
for (i = 0; i < THREAD_MAX; i++)
Threads[i].activeSplitPoints = 0;
// Initialize global locks
lock_init(&MPLock, NULL);
lock_init(&IOLock, NULL);
@ -591,12 +588,7 @@ void init_threads() {
// All threads except the main thread should be initialized to idle state
for (i = 1; i < THREAD_MAX; i++)
{
Threads[i].stop = false;
Threads[i].workIsWaiting = false;
Threads[i].idle = true;
Threads[i].running = false;
}
// Launch the helper threads
for (i = 1; i < THREAD_MAX; i++)

View file

@ -26,6 +26,8 @@
//// Includes
////
#include <cstring>
#include "lock.h"
#include "movepick.h"
#include "position.h"
@ -64,6 +66,9 @@ struct SplitPoint {
struct Thread {
Thread() { memset(this, 0, sizeof(Thread)); }
SplitPoint *splitPoint;
volatile int activeSplitPoints;
uint64_t nodes;