dereferencing anonymous pointers 
Author Message
 dereferencing anonymous pointers

Quote:

> I have some code wherein I use posix threads, which are being created
> dynamically.  To track them, I'm using glib's singly-linked list
> implementation and storing a pointer to the pthread_t that gets created.
> Now, in order to call pthread_join, I need to dereference the
> anonymous pointer

What's an anonymous pointer?  A void pointer perhaps?

Quote:
> that's pointing to that thread.  i.e., something
> like
>    status=pthread_join( *thread_list[0].data, NULL );

> but gcc complains about doing that.

Cast your void pointer to the structure type that it points to,
then use the result of the cast.
--
"You call this a *C* question? What the hell are you smoking?" --Kaz


Sat, 04 Jan 2003 03:00:00 GMT  
 dereferencing anonymous pointers

Quote:

> I have some code wherein I use posix threads, which are being created
> dynamically.  To track them, I'm using glib's singly-linked list
> implementation and storing a pointer to the pthread_t that gets created.
> Now, in order to call pthread_join, I need to dereference the
> anonymous pointer that's pointing to that thread.  i.e., something
> like
>    status=pthread_join( *thread_list[0].data, NULL );

> but gcc complains about doing that.

What does it complain about? And how are pthread_join(), thread_list,
and thread_list[0].data defined?

Richard



Sat, 04 Jan 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Dereferencing f-pointers, arrays of f-pointers, pointers to f-pointers

2. dereferencing pointer to a structure containing a pointer to int

3. Dereferencing pointer to incomplete type

4. Structure Pointer Dereferencing

5. Problem with: dereferencing pointer to incomplete type

6. dereferencing NULL pointers in AIX

7. Dereferencing pointers...?

8. dereferencing NULL pointers and string functions

9. "dereferencing pointer to incomplete type"

10. struct datatype scope (dereferencing pointer to incomplete type)

11. Structure Pointer Dereferencing

12. Function pointer dereferencing

 

 
Powered by phpBB® Forum Software