pthread,CCNotificationCenter使用时崩溃

我创建了一个子线程,通过CCNotifycationCenter向主线程发送消息,
但运行几秒后会崩溃,请问是什么原因?
代码如下:

bool HelloWorld::init()

CCNotificationCenter::sharedNotificationCenter()->addObserver(this, callfuncO_selector(HelloWorld::onThreadMessage), “hh”, NULL);

pthread_t t;
pthread_create(&t, NULL, run, NULL);

return true;

}
pthread_mutex_t sharedNotificationQueueLock;
static void* run(void* arg)
{
while (true) {
std::string str = “hh”;
CCLog(“hello,i am thread”);
pthread_mutex_lock(&sharedNotificationQueueLock);
CCNotificationCenter::sharedNotificationCenter()->postNotification(str.c_str());
pthread_mutex_unlock(&sharedNotificationQueueLock);
}
}
void HelloWorld::onThreadMessage(CCObject* pSender)
{
CCLog(“hello ,i am main thread”);
}