Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

vipl_win_thread.c File Reference

#include <process.h>
#include <windows.h>
#include <winsock.h>
#include "vipl_win_thread.h"

Go to the source code of this file.

Data Structures

struct  thread_t

Typedefs

typedef thread_t thread_t

Functions

void vipl_win_init (void)
unsigned __stdcall vipl_win_thread_create_helper (void *p)
int vipl_win_thread_create (vipl_win_thread_t *thread, void *(*start_routine)(void *), void *arg)
int vipl_win_thread_join (vipl_win_thread_t t, void **thread_return)
void vipl_win_thread_exit (void *retval)
VIP_ENTRY_POINT unsigned long vipl_win_thread_self (void)


Detailed Description

The VI-GM thread functions implementation for Win32.

Definition in file vipl_win_thread.c.


Typedef Documentation

typedef struct thread_t thread_t
 

This structure describes a native thread in the Windows port.


Function Documentation

void vipl_win_init void   ) 
 

This function, declared in vipl_win_init.cpp, is a trick to allow static initialization of mutexes in the Windows port. It declares a constructor and a destructor methods to catch the first usage of the mutexes.

Author:
Eugene Chun
Version:
1.0

Referenced by vipl_win_thread_create().

unsigned __stdcall vipl_win_thread_create_helper void *  p  ) 
 

This function executes the thread routine in the context of the thread (Windows port).

Return values:
0 Success.
-1 Failure.
Parameters:
p (IN) The pointer to the thread structure.
Author:
Eugene Chun
Version:
1.0

Definition at line 53 of file vipl_win_thread.c.

References thread_t::arg, and thread_t::start_routine.

Referenced by vipl_win_thread_create().

int vipl_win_thread_create vipl_win_thread_t thread,
void *(*)(void *)  start_routine,
void *  arg
 

This function create a new thread (Windows port).

Return values:
0 Success.
-1 Failure.
Parameters:
thread (IN) The thread structure in the Windows port.
start_routine (IN) The routine executed by the thread.
arg (IN) The argument passed to the thread at creation time.
See also:
VIP_THREAD_CREATE
Author:
Eugene Chun
Version:
1.0

Definition at line 80 of file vipl_win_thread.c.

References threadinfo_t::arg, threadinfo_t::start_routine, vipl_win_thread_t::thread, vipl_win_thread_t::ti, vipl_win_init(), and vipl_win_thread_create_helper().

int vipl_win_thread_join vipl_win_thread_t  t,
void **  thread_return
 

This function waits for another thread to exit (Windows port).

Return values:
0 Success.
-1 Failure.
Parameters:
t (IN) The handle to the thread to join.
thread_return (OUT) The return code of the terminated thread.
See also:
VIP_THREAD_JOIN
Author:
Eugene Chun
Version:
1.0

Definition at line 114 of file vipl_win_thread.c.

References vipl_win_thread_t::thread, and vipl_win_thread_t::ti.

void vipl_win_thread_exit void *  retval  ) 
 

This function terminates the current thread (Windows port).

Parameters:
retval (IN) The return value return to the parent process when the tread is terminating.
See also:
VIP_THREAD_EXIT
Author:
Eugene Chun
Version:
1.0

Definition at line 135 of file vipl_win_thread.c.

VIP_ENTRY_POINT unsigned long vipl_win_thread_self void   ) 
 

This function returns the ID of the current thread (Windows port).

Returns:
The ID of the current thread.
See also:
VIP_THREAD_SELF
Author:
Eugene Chun
Version:
1.0

Definition at line 153 of file vipl_win_thread.c.

VI-GM-1.3 by Myricom © 1997-2006. Documentation generated on 20 May 2006 by doxygen 1.4.4.