0
내 프로그램 (아래)은 Fedora 22에서 작동하거나 main()에서 스레드 함수를 직접 호출하면 작동합니다. 하지만 우분투 16.04의 스레드에서 모노 호출을 실행하면 다음과 같이 나타납니다. 내가 뭔가 잘못하고 있는거야?우분투 스레드에서 모노 크래시
하워드 루빈
출력 :
$ rm monotest.dll ; make ; ./monotest
Mono C# compiler version 4.8.0.0
mcs monotest.cs /out:monotest.dll /target:library
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
g++ monotest.cpp -o monotest -g3 -std=c++11 `pkg-config --cflags --libs mono-2`
* Assertion at mono-threads-posix.c:265, condition `info->handle' not met
Aborted (core dumped)
$
=============================== ===
// monotest.cpp
#include <thread>
#include <mono/jit/jit.h>
void Thread() {
MonoDomain* domain = mono_jit_init("monotest.dll");
mono_jit_cleanup(domain);
}
int main() {
//Thread();
std::thread t(Thread);
t.join();
}
==================================
////////////////////////
// monotest.cs
namespace MyNamespace {
public class MyClass {
public MyClass() { }
public void MySum(int arg1, int arg2) {
System.Console.WriteLine("MySum(" + arg1 + "," + arg2 + ") => " + (arg1 + arg2));
}
}
}
================= =================
###################
# Makefile
monotest : monotest.cpp monotest.dll Makefile
@g++ --version | head -1
g++ $< -o [email protected] -g3 -std=c++11 `pkg-config --cflags --libs mono-2`
monotest.dll : monotest.cs
@mcs --version
mcs $< /out:[email protected] /target:library