From kde-devel Tue Mar 07 08:20:05 2000 From: Roberto Alsina Date: Tue, 07 Mar 2000 08:20:05 +0000 To: kde-devel Subject: Re: Multithreading with Pth HOWTO X-MARC-Message: https://marc.info/?l=kde-devel&m=95243903318908 On Tue, 7 Mar 2000, Andreas Zehender wrote: > Roberto Alsina wrote: > > void *slotDoLongThingThread(void *arg); > > > > void MyButton::slotDoLongThing(void) > > { > > //This defines some aspects of the child thread, look at the Pth > > //docs. > > pth_attr_t attr = pth_attr_new(); > > pth_attr_set(attr,PTH_ATTR_CANCEL_STATE,PTH_CANCEL_ASYNCHRONOUS); > > pth_attr_set(attr,PTH_ATTR_JOINABLE,FALSE); > > pth_attr_set(attr, PTH_ATTR_STACK_SIZE, 128*1024); > > pth_spawn(attr,query_actions_thread,this); > > } > > What is query_actions_thread here? Do you mean slotDoLongThingThread? > Or how is slotDoLongThingThread called? Yikes, that's what I get by trying to write examples by copy/paste ;-) It is indeed slotDoLongThingThread. > > > > > //The real function that does the work. > > void *slotDoLongThingThread(void *arg) > > { > > MyButton *myb=(MyButton *)arg; > > bool a; > > for (;a;) > > { > > a=doSomething(); > > myb->doThingWithButton(); > > pth_yield(NULL); > > } > > return NULL; > > } > > > > Greetings, Andreas > -- > ------------------------------------------------------------------------ > Andreas Zehender http://www.ba-stuttgart.de/~azehende > BA-Stuttgart mailto:azehende@ba-stuttgart.de > 6. Semester //// > Informationstechnik (o o) > ------------------------oOO--(_)--OOo----------------------------------- > > ("\''/").__..-''"`-. . Roberto Alsina `9_ 9 ) `-. ( ).`-._.`) ralsina@unl.edu.ar (_Y_.)' ._ ) `._`. " -.-' Centro de Telematica _..`-'_..-_/ /-'_.' Universidad Nacional del Litoral (l)-'' ((i).' ((!.' Santa Fe - Argentina KDE Developer (MFCH) The stone age didn't end for a lack of stone" Firoz Rasul