Commit f213a1d6 authored by Sam Hocevar's avatar Sam Hocevar

* ./src/libvlc.c: switched the position of msg_Create() and system_Init()

    because the BeOS system_Init spawns a thread, which makes use of msg_*
    functions.
  * ./src/misc/threads.c, ./src/misc/win32_specific.c: put the detection
    of SignalObjectAndWait in the thread system initialization because
    system_Init() now happens after msg_Create().
parent 07dcfb3f
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libvlc.c: main libvlc source * libvlc.c: main libvlc source
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2002 VideoLAN * Copyright (C) 1998-2002 VideoLAN
* $Id: libvlc.c,v 1.30 2002/08/21 09:26:53 xav Exp $ * $Id: libvlc.c,v 1.31 2002/09/17 14:56:13 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -242,14 +242,14 @@ vlc_error_t vlc_init_r( vlc_t *p_vlc, int i_argc, char *ppsz_argv[] ) ...@@ -242,14 +242,14 @@ vlc_error_t vlc_init_r( vlc_t *p_vlc, int i_argc, char *ppsz_argv[] )
#endif #endif
/* /*
* System specific initialization code * Initialize message queue
*/ */
system_Init( p_vlc, &i_argc, ppsz_argv ); msg_Create( p_vlc );
/* /*
* Initialize message queue * System specific initialization code
*/ */
msg_Create( p_vlc ); system_Init( p_vlc, &i_argc, ppsz_argv );
/* Get the executable name (similar to the basename command) */ /* Get the executable name (similar to the basename command) */
if( i_argc > 0 ) if( i_argc > 0 )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* threads.c : threads implementation for the VideoLAN client * threads.c : threads implementation for the VideoLAN client
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* $Id: threads.c,v 1.15 2002/08/30 23:27:06 massiot Exp $ * $Id: threads.c,v 1.16 2002/09/17 14:56:13 sam Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -104,7 +104,7 @@ int __vlc_threads_init( vlc_object_t *p_this ) ...@@ -104,7 +104,7 @@ int __vlc_threads_init( vlc_object_t *p_this )
#elif defined( ST_INIT_IN_ST_H ) #elif defined( ST_INIT_IN_ST_H )
/* Unimplemented */ /* Unimplemented */
#elif defined( WIN32 ) #elif defined( WIN32 )
/* Unimplemented */ HINSTANCE hInstLib;
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
pthread_mutex_lock( &once_mutex ); pthread_mutex_lock( &once_mutex );
#elif defined( HAVE_CTHREADS_H ) #elif defined( HAVE_CTHREADS_H )
...@@ -122,7 +122,26 @@ int __vlc_threads_init( vlc_object_t *p_this ) ...@@ -122,7 +122,26 @@ int __vlc_threads_init( vlc_object_t *p_this )
#elif defined( ST_INIT_IN_ST_H ) #elif defined( ST_INIT_IN_ST_H )
i_ret = st_init(); i_ret = st_init();
#elif defined( WIN32 ) #elif defined( WIN32 )
/* Unimplemented */ /* dynamically get the address of SignalObjectAndWait */
if( GetVersion() < 0x80000000 )
{
/* We are running on NT/2K/XP, we can use SignalObjectAndWait */
hInstLib = LoadLibrary( "kernel32" );
if( hInstLib )
{
p_this->p_vlc->SignalObjectAndWait =
(SIGNALOBJECTANDWAIT)GetProcAddress( hInstLib,
"SignalObjectAndWait" );
}
}
else
{
p_this->p_vlc->SignalObjectAndWait = NULL;
}
p_this->p_vlc->b_fast_mutex = 0;
p_this->p_vlc->i_win9x_cv = 0;
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
/* Unimplemented */ /* Unimplemented */
#elif defined( HAVE_CTHREADS_H ) #elif defined( HAVE_CTHREADS_H )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* win32_specific.c: Win32 specific features * win32_specific.c: Win32 specific features
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: win32_specific.c,v 1.14 2002/08/11 08:30:01 gbazin Exp $ * $Id: win32_specific.c,v 1.15 2002/09/17 14:56:13 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Gildas Bazin <gbazin@netcourrier.com> * Gildas Bazin <gbazin@netcourrier.com>
...@@ -37,19 +37,6 @@ void system_Init( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] ) ...@@ -37,19 +37,6 @@ void system_Init( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] )
{ {
WSADATA Data; WSADATA Data;
int i_err; int i_err;
HINSTANCE hInstLib;
/* dynamically get the address of SignalObjectAndWait */
if( (GetVersion() < 0x80000000) )
{
/* We are running on NT/2K/XP, we can use SignalObjectAndWait */
hInstLib = LoadLibrary( "kernel32" );
if( hInstLib)
p_this->p_vlc->SignalObjectAndWait =
(SIGNALOBJECTANDWAIT)GetProcAddress( hInstLib,
"SignalObjectAndWait" );
}
else p_this->p_vlc->SignalObjectAndWait = NULL;
/* WinSock Library Init. */ /* WinSock Library Init. */
i_err = WSAStartup( MAKEWORD( 1, 1 ), &Data ); i_err = WSAStartup( MAKEWORD( 1, 1 ), &Data );
...@@ -59,10 +46,8 @@ void system_Init( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] ) ...@@ -59,10 +46,8 @@ void system_Init( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] )
fprintf( stderr, "error: can't initiate WinSocks, error %i\n", i_err ); fprintf( stderr, "error: can't initiate WinSocks, error %i\n", i_err );
} }
p_this->p_vlc->b_fast_mutex = 0; /* Set the default file-translation mode */
p_this->p_vlc->i_win9x_cv = 0; _fmode = _O_BINARY;
_fmode = _O_BINARY; /* sets the default file-translation mode */
} }
/***************************************************************************** /*****************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment