mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-16 09:21:52 +03:00
Windows porting: port hyperscan and chimera tools to windows.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Intel Corporation
|
||||
* Copyright (c) 2015-2018, Intel Corporation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -35,8 +35,7 @@
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
static const size_t COLLIDER_THREAD_STACK_SIZE = 8192 * 1024;
|
||||
|
||||
void Thread::start() {
|
||||
@@ -79,6 +78,16 @@ create_thread:
|
||||
}
|
||||
}
|
||||
|
||||
void Thread::join() { pthread_join(thread, nullptr); }
|
||||
|
||||
#else // windows
|
||||
|
||||
void Thread::start() { thread = std::thread(&runThread, this); }
|
||||
|
||||
void Thread::join() { thread.join(); }
|
||||
|
||||
#endif
|
||||
|
||||
// Dispatch
|
||||
void *Thread::runThread(void *thr) {
|
||||
if (!no_signal_handler) {
|
||||
@@ -88,7 +97,6 @@ void *Thread::runThread(void *thr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Thread::join() { pthread_join(thread, nullptr); }
|
||||
|
||||
Thread::Thread(size_t num) : thread_id(num) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user