[問題] C++/CLI and Thread
我建立了一個 windows form 專案
並且在 windows form 第一次載入時開啟了一個 managed thread
然後調用了一個 OpenGL 的外部庫
其中有一個函式內建會使用 win32 原生的 thread (unmanaged thread)
而這個 thread 所使用的函式是由我傳入的
我試著用 ManualResetEvent 來使兩者保持一定的執行順序
但是 CLR 似乎把 unmanaged thread 視為 UI thread 而導致錯誤?
我試著在傳入thread的函式中還有 UI thread 中 output
Thread::CurrentThread::ManagedID
發現兩者是相同的
但我可以肯定 OpenGL 函式一定有開一個 unmanaged thread
請問是不是要作什麼處理?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.136.245.39
推
11/09 20:52, , 1F
11/09 20:52, 1F
→
11/09 21:09, , 2F
11/09 21:09, 2F
→
11/09 21:10, , 3F
11/09 21:10, 3F
→
11/09 21:10, , 4F
11/09 21:10, 4F
→
11/09 21:11, , 5F
11/09 21:11, 5F
推
11/10 18:56, , 6F
11/10 18:56, 6F
推
11/10 19:10, , 7F
11/10 19:10, 7F
→
11/10 19:11, , 8F
11/10 19:11, 8F
→
11/10 19:11, , 9F
11/10 19:11, 9F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章