Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #8228
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Ian Collins <ian-news@hotmail.com> |
| Newsgroups | comp.lang.c++ |
| Subject | Re: simple pthread |
| Date | Tue, 26 Jul 2011 16:45:54 +1200 |
| Lines | 34 |
| Message-ID | <996v46FkjtU2@mid.individual.net> (permalink) |
| References | <34eba984-d360-46c0-a5ec-71abf8c1ee00@glegroupsg2000goo.googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-Trace | individual.net 2MBAUqDq5hMxKNXO/UlX2ghFUAVBYjtmppKF8zIO1TdGx6HF5v |
| Cancel-Lock | sha1:tULTO88Ujf11FBWOMuhTQ+72aoA= |
| User-Agent | Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.2.9) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.4 |
| In-Reply-To | <34eba984-d360-46c0-a5ec-71abf8c1ee00@glegroupsg2000goo.googlegroups.com> |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.c++:8228 |
Show key headers only | View raw
On 07/26/11 04:15 PM, cerr wrote:
>> This looks like a mixed up function declaration!
>
> Yep, exactly right... :o
>>
>>
>> int something = pthread_create( );
>>
>> A decent compiler should tell you that MyThread::PrintMsg is the wrong
>> function type for the function pointer parameter of pthread_create.
>
> I'm using g++ and io got this now:
> int MyThread::StartMe(void)
> {
> pthread_create(&ThreadA, NULL,&MyThread::PrintMsg, void);
> }
> //-------------------------------------------------------------
> and the compiler tells me:
> $ g++ -o example example.cpp
> example.cpp: In member function ‘int MyThread::StartMe()’:
> example.cpp:42:55: error: expected primary-expression before ‘void’
>
> what is a primary expression in this case? :o
> Thanks,
Firstly, please don't use the sociopathic "new" google interface, it
ruins threading!.
It looks like you missed my other comments, go be back and check, 'void'
isn't a valid parameter value and a member function isn't a valid thread
function.
--
Ian Collins
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: simple pthread cerr <ron.eggler@gmail.com> - 2011-07-25 21:15 -0700
Re: simple pthread Ian Collins <ian-news@hotmail.com> - 2011-07-26 16:45 +1200
Re: simple pthread cerr <ron.eggler@gmail.com> - 2011-07-25 22:54 -0700
Re: simple pthread Paul Brettschneider <paul.brettschneider@yahoo.fr> - 2011-07-26 08:09 +0200
Re: simple pthread cerr <ron.eggler@gmail.com> - 2011-07-25 23:15 -0700
Re: simple pthread Ian Collins <ian-news@hotmail.com> - 2011-07-26 19:41 +1200
Re: simple pthread Paul Brettschneider <paul.brettschneider@yahoo.fr> - 2011-07-26 17:35 +0200
csiph-web