OpenSync Thread Internals
[OpenSync Common Module Private]

Some threading functions. More...


Typedefs

typedef struct OSyncThread OSyncThread

Functions

OSYNC_TEST_EXPORT OSyncThreadosync_thread_new (GMainContext *context, OSyncError **error)
 Allocates a new thread with a g_mainloop.
OSYNC_TEST_EXPORT OSyncThreadosync_thread_ref (OSyncThread *thread)
 Increases the reference count on thread object.
OSYNC_TEST_EXPORT void osync_thread_unref (OSyncThread *thread)
 Decrements reference count on thread object.
OSYNC_TEST_EXPORT void osync_thread_start (OSyncThread *thread)
 Start thread and it's mainloop.
OSYNC_TEST_EXPORT void osync_thread_stop (OSyncThread *thread)
 Stops thread's mainloop and joins the thread.
OSYNC_TEST_EXPORT void osync_thread_exit (OSyncThread *thread, int retval)
 Exit thread.
OSYNC_TEST_EXPORT OSyncThreadosync_thread_create (GThreadFunc func, void *userdata, OSyncError **error)
 Start thread and it's mainloop.


Detailed Description

Some threading functions.

Function Documentation

OSYNC_TEST_EXPORT OSyncThread* osync_thread_new ( GMainContext *  context,
OSyncError **  error 
)

Allocates a new thread with a g_mainloop.

Parameters:
context Pointer to GMainContext
error The error which will hold the info in case of an error
Returns:
A pointer to the new allocated OSyncThread with inactive thread and mainloop

Definition at line 47 of file opensync_thread.c.

Referenced by osync_engine_new(), and osync_queue_connect().

OSYNC_TEST_EXPORT OSyncThread* osync_thread_ref ( OSyncThread thread  ) 

Increases the reference count on thread object.

Parameters:
thread Pointer to OSyncThread

Definition at line 74 of file opensync_thread.c.

OSYNC_TEST_EXPORT void osync_thread_unref ( OSyncThread thread  ) 

Decrements reference count on thread object.

Parameters:
thread Pointer to OSyncThread

Definition at line 85 of file opensync_thread.c.

Referenced by osync_queue_disconnect().

OSYNC_TEST_EXPORT void osync_thread_start ( OSyncThread thread  ) 

Start thread and it's mainloop.

Parameters:
thread Thread object

Definition at line 156 of file opensync_thread.c.

Referenced by osync_queue_connect().

OSYNC_TEST_EXPORT void osync_thread_stop ( OSyncThread thread  ) 

Stops thread's mainloop and joins the thread.

Parameters:
thread Thread object

Definition at line 172 of file opensync_thread.c.

Referenced by osync_queue_disconnect().

OSYNC_TEST_EXPORT void osync_thread_exit ( OSyncThread thread,
int  retval 
)

Exit thread.

Parameters:
thread Thread object
retval Return value of thread while exiting

Definition at line 190 of file opensync_thread.c.

OSYNC_TEST_EXPORT OSyncThread* osync_thread_create ( GThreadFunc  func,
void *  userdata,
OSyncError **  error 
)

Start thread and it's mainloop.

Parameters:
func GThreadFunc Pointer
userdata Custom data poitner which get supplied to thread function
error Pointer to error struct
Returns:
Newly allocate OSyncThread object with inactive mainloop

Definition at line 122 of file opensync_thread.c.

Referenced by osync_updater_process().


Generated on Fri Feb 13 13:33:29 2009 for OpenSync by  doxygen 1.5.7.1