Подскажите в чем проблема.
Есть:
//-----cthread.cpp
#include "cthread.h"
bool cThread::create_thread()
{
return pthread_create(&pthread_id, NULL, thread_int, this);
return true;
}
void* cThread::thread_int(void *param)
{
return NULL;
}
//-----cthread.h
#ifndef CTHREAD_CLASS
#define CTHREAD_CLASS
#include <iostream>
#include <cstdlib>
#include <pthread.h>
class cThread
{
public:
cThread(){};
~cThread() {};
bool create_thread();
private:
static void* thread_int(void *param);
pthread_t pthread_id;
};
#endif
//-----main.cpp
#include "cthread.h"
#include <unistd.h>
using namespace std;
int main(int argc, char *argv[])
{
cThread *cth = new cThread();
cout << "Hello, world!" << endl;
cth->create_thread();
sleep(1);
return EXIT_SUCCESS;
}
все собирается на ура. Но при вызове pthread_create происходит
Segmtntation fault.
Подскажите почему ?!

Ответ на:
комментарий
от tarle

Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.
Похожие темы
- Форум Структура epoll сервера (2010)
- Форум C++ и pthread (2009)
- Форум Управление потоками с использованием pthread (2014)
- Форум pthread (2006)
- Форум pthread не работает (2006)
- Форум Реализовать последовательно-параллельный запуск потоков (2017)
- Форум Posix Threads (2005)
- Форум pthread (2008)
- Форум C++/exceptions - деление на ноль не ловиццо, почему? (2006)
- Форум Linux + pthread глюки (2008)