How create Win32api Thread in Dlang?

Marcone marcone at email.com
Sat Sep 26 03:08:56 UTC 2020


This is C++ code:

#include <windows.h>

WINAPI DWORD threadFunc(LPVOID x) {
   while (true) {
     try {
       throw 1;
     } catch (...) {
     }
   }
   return 0;
}

int main(int argc, char *argv[]) {
   CreateThread(NULL, 0, threadFunc, NULL, 0, NULL);
   CreateThread(NULL, 0, threadFunc, NULL, 0, NULL);

   Sleep(1000);

   return 0;
}

How can I convert it to Dlang?


More information about the Digitalmars-d-learn mailing list