Thread: Is it possible to set/get user data to HANDLE/pthread_t?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,735

    Is it possible to set/get user data to HANDLE/pthread_t?

    Every attempt to find the information on the net just keeps coming up with irrelevant results around pthread_create() instead of say pthread_get_ud( thread )/pthread_set_ud( thread, ud ), I would prefer being able to get the final argument that gets passed onto the thread but no matter what I search it doesn't seem to be a thing despite it being such an obvious feature to need, just like windows, gc objects & others need.

    Edit: To be clear it's these sort of actions I'd like to do something similar to:
    Code:
    glfwSetWindowUserPointer( Win->handle, Win );
    ...
    void	onClosed( GLFWwindow *handle )
    {
    	pawWIN Win = glfwGetWindowUserPointer( handle );
    	if ( Win->onClosedCB )
    		Win->onClosedCB( Win );
    }
    Where all I have is the source api's reference to begin with

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data types and user input
    By john.joseph.law in forum C++ Programming
    Replies: 3
    Last Post: 09-19-2012, 03:14 AM
  2. Which is a better practice? (Global handle or finding handle)
    By C_Sparky in forum Windows Programming
    Replies: 4
    Last Post: 12-31-2010, 07:32 PM
  3. How to handle inputs if the user inputs the wrong thing
    By bassist11 in forum C Programming
    Replies: 5
    Last Post: 09-22-2010, 04:28 AM
  4. protect data from user
    By rogster001 in forum C Programming
    Replies: 8
    Last Post: 08-27-2010, 06:23 PM
  5. prompting user for data
    By radical in forum C Programming
    Replies: 5
    Last Post: 07-28-2005, 11:45 AM

Tags for this Thread