Skip to content

Commit 6c3d1f2

Browse files
committed
DBG: make x64dbg run under Wine again
1 parent 188b74b commit 6c3d1f2

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
path = deps
1212
url = https://github.com/x64dbg/deps
1313
shallow = true
14+
[submodule "src/dbg/concurrentqueue"]
15+
path = src/dbg/concurrentqueue
16+
url = https://github.com/cameron314/concurrentqueue.git
1417
[submodule "src/zydis_wrapper/zydis"]
1518
path = src/zydis_wrapper/zydis
1619
url = https://github.com/zyantific/zydis.git

src/dbg/concurrentqueue

Submodule concurrentqueue added at 4b5b0c6

src/dbg/msgqueue.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ bool MsgSend(MESSAGE_STACK* Stack, int Msg, duint Param1, duint Param2)
4242
newMessage.param2 = Param2;
4343

4444
// Asynchronous send
45-
asend(Stack->msgs, newMessage);
45+
Stack->msgs.enqueue(newMessage);
4646
return true;
4747
}
4848

@@ -53,7 +53,7 @@ bool MsgGet(MESSAGE_STACK* Stack, MESSAGE* Msg)
5353
return false;
5454

5555
// Don't increment the wait count because this does not wait
56-
return try_receive(Stack->msgs, *Msg);
56+
return Stack->msgs.try_dequeue(*Msg);
5757
}
5858

5959
// Wait for a message on the specified stack
@@ -64,6 +64,6 @@ void MsgWait(MESSAGE_STACK* Stack, MESSAGE* Msg)
6464

6565
// Increment/decrement wait count
6666
InterlockedIncrement((volatile long*)&Stack->WaitingCalls);
67-
*Msg = Stack->msgs.dequeue();
67+
Stack->msgs.wait_dequeue(*Msg);
6868
InterlockedDecrement((volatile long*)&Stack->WaitingCalls);
6969
}

src/dbg/msgqueue.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define _MSGQUEUE_H
33

44
#include "_global.h"
5-
#include <agents.h>
5+
#include "concurrentqueue/blockingconcurrentqueue.h"
66

77
#define MAX_MESSAGES 256
88

@@ -18,7 +18,7 @@ struct MESSAGE
1818
class MESSAGE_STACK
1919
{
2020
public:
21-
Concurrency::unbounded_buffer<MESSAGE> msgs;
21+
moodycamel::BlockingConcurrentQueue<MESSAGE> msgs;
2222

2323
int WaitingCalls; // Number of threads waiting
2424
bool Destroy; // Destroy stack as soon as possible

src/dbg/taskthread.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include <thread>
77
#include <tuple>
88
#include <type_traits>
9-
#include <utility>
109

1110
const size_t TASK_THREAD_DEFAULT_SLEEP_TIME = 100;
1211
template <typename F, typename... Args>
@@ -121,7 +120,7 @@ template <typename F, typename... Args> void TaskThread_<F, Args...>::Loop()
121120
if(this->active)
122121
{
123122
apply_from_tuple(this->fn, argLatch);
124-
std::this_thread::sleep_for(std::chrono::milliseconds(this->minSleepTimeMs));
123+
Sleep(this->minSleepTimeMs);
125124
++this->execs;
126125
}
127126
}

0 commit comments

Comments
 (0)