I will wait with this code.
WaitForSingleObject(threading, INFINITE);
On Thursday, 19 November 2020 at 15:51:09 UTC, Kagamin wrote:
The delegate is stored on the stack of the calling thread, the
created thread loads it from there, but the calling thread
doesn't wait for that and clobbers the stack right away. If you
were lucky your code would crash.
The thread
The delegate is stored on the stack of the calling thread, the
created thread loads it from there, but the calling thread
doesn't wait for that and clobbers the stack right away. If you
were lucky your code would crash.
Solved replacing this line:
CreateThread(null, 0, &_fun, &fun, 0, null);
to this code:
task!({CreateThread(null, 0, &_fun, &fun, 0,
null);}).executeInNewThread();
On Thursday, 19 November 2020 at 04:23:13 UTC, Marcone wrote:
// Function threadingw()
void threadingw(HWND hwn, void delegate() fun) nothrow {
try {
// Function _fun()
extern(Windows)
uint _fun(void * arg){
(*(cast(void delegate()*) arg)