реклама на сайте
подробности

 
 
> программа вылетает при запуске треда, uClinux
andybeg
сообщение Feb 11 2011, 12:57
Сообщение #1


Частый гость
**

Группа: Участник
Сообщений: 133
Регистрация: 30-11-06
Пользователь №: 22 954



перестали запускаться треды в тестовой программе
Цитата
#include <pthread.h>
pthread_t master_thread;
void* fmaster(void)
{
printf("thread\n");
}
int main()
{
int s;
printf("thread\n");
s = pthread_create(&master_thread, 0,fmaster,0);
if (s != 0)
printf("errcode %d",s);
while(1)
{
printf("main thread\n");
}
return 0;
}

прграмма комилируется и вылетает не печатая printf("errcode %d",s);
понимаю что где то в ядре надо это настроить, но make menuconfig ничего похожего не выдаёт, раньше потоки работали, но корявые ручки что то не там поправили sad.gif
Go to the top of the page
 
+Quote Post
 
Start new topic
Ответов
andybeg
сообщение Feb 14 2011, 09:33
Сообщение #2


Частый гость
**

Группа: Участник
Сообщений: 133
Регистрация: 30-11-06
Пользователь №: 22 954



прошёлся по функции pthread_create, выяснилось что она вылетает на
Цитата
int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
void * (*start_routine)(void *), void *arg)
{
pthread_descr self = thread_self();
struct pthread_request request;

if (__pthread_manager_request < 0) {
if (__pthread_initialize_manager() < 0) return EAGAIN;
}

request.req_thread = self;
request.req_kind = REQ_CREATE;
request.req_args.create.attr = attr;
request.req_args.create.fn = start_routine;
request.req_args.create.arg = arg;
sigprocmask(SIG_SETMASK, (const sigset_t *) NULL,
&request.req_args.create.mask);
PDEBUG("write REQ_CREATE to manager thread\n");
TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
(char *) &request, sizeof(request)));
PDEBUG("before suspend(self)\n");
suspend(self);<<<<<<<<<<<<<<<<<<<вылетает тут
PDEBUG("after suspend(self)\n");
if (THREAD_GETMEM(self, p_retcode) == 0)
*thread = (pthread_t) THREAD_GETMEM(self, p_retval);
printf("exit\n");
return THREAD_GETMEM(self, p_retcode);
}

Цитата
static inline void suspend(pthread_descr self)
{
/* See pthread.c */
#ifdef __NR_rt_sigaction
__pthread_wait_for_restart_signal(self);
#else
__pthread_suspend(self);
#endif
}


Сообщение отредактировал andybeg - Feb 14 2011, 09:34
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 22nd June 2025 - 23:37
Рейтинг@Mail.ru


Страница сгенерированна за 0.01357 секунд с 7
ELECTRONIX ©2004-2016