Commit d7ea77e2 authored by sletz's avatar sletz
Browse files

Cleanup on Windows.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2942 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 357e8232
/*
Copyright (C) 2001 Paul Davis
Copyright (C) 2001 Paul Davis
Copyright (C) 2004-2008 Grame
Copyright (C) 2008 Nedko Arnaudov
......@@ -40,7 +40,7 @@ void change_thread_log_function(jack_log_function_t log_function)
}
SERVER_EXPORT void set_threaded_log_function()
{
{
change_thread_log_function(Jack::JackMessageBufferAdd);
}
......@@ -68,7 +68,7 @@ static void jack_format_and_log(int level, const char *prefix, const char *fmt,
char buffer[300];
size_t len;
jack_log_function_t log_function;
if (prefix != NULL) {
len = strlen(prefix);
memcpy(buffer, prefix, len);
......
......@@ -21,10 +21,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include "config.h"
#endif
#ifdef WIN32
#pragma warning (disable : 4786)
#endif
#include "JackServerGlobals.h"
#include "JackTools.h"
#include "shm.h"
......@@ -76,9 +72,9 @@ int JackServerGlobals::Delete()
bool JackServerGlobals::Init()
{
// Server already started
if (JackServer::fInstance != NULL)
if (JackServer::fInstance != NULL)
return true;
int realtime = 0;
int client_timeout = 0; /* msecs; if zero, use period size. */
int realtime_priority = 10;
......@@ -88,7 +84,7 @@ bool JackServerGlobals::Init()
int loopback = 0;
int do_unlock = 0;
int temporary = 0;
int opt = 0;
int option_index = 0;
int seen_driver = 0;
......@@ -107,12 +103,12 @@ bool JackServerGlobals::Init()
char buffer[255];
int argc = 0;
char* argv[32];
// Otherwise first client starts the server
if (fClientCount++ == 0) {
jack_log("JackServerGlobals Init");
jack_driver_desc_t* driver_desc;
const char *options = "-ad:P:uvshVRL:STFl:t:mn:p:";
static struct option long_options[] = {
......@@ -134,7 +130,7 @@ bool JackServerGlobals::Init()
{ "sync", 0, 0, 'S' },
{ 0, 0, 0, 0 }
};
snprintf(filename, 255, "%s/.jackdrc", getenv("HOME"));
fp = fopen(filename, "r");
......@@ -307,7 +303,7 @@ bool JackServerGlobals::Init()
goto error;
}
}
if (driver_params)
jack_free_driver_params(driver_params);
return true;
......
......@@ -24,8 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "varargs.h"
#include "types.h"
int server_connect(char* name);
int try_start_server(jack_varargs_t* va, jack_options_t options, jack_status_t* status);
int start_server(const char* server_name, jack_options_t options);
#endif
......@@ -39,7 +39,7 @@ using namespace Jack;
#include <dbus/dbus.h>
int start_server_dbus(const char* server_name)
static int start_server_dbus(const char* server_name)
{
DBusError err;
DBusConnection *conn;
......
......@@ -27,12 +27,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#define UnloadDriverModule(handle) (FreeLibrary(((HMODULE)handle)))
#define GetProc(handle, name) GetProcAddress(((HMODULE)handle),(name))
#pragma warning (disable : 4786)
#define ENOBUFS 55
#define JACK_DEBUG false
#define try_start_server 0
#endif
......@@ -50,7 +50,7 @@ class JackWinMutex
void Lock()
{
DWORD dwWaitResult = WaitForSingleObject(fMutex, INFINITE);
WaitForSingleObject(fMutex, INFINITE);
}
bool Trylock()
......
......@@ -21,10 +21,6 @@ Copyright (C) 2004-2006 Grame
#include "config.h"
#endif
#ifdef WIN32
#pragma warning (disable : 4786)
#endif
#include "JackWinNamedPipeServerChannel.h"
#include "JackNotification.h"
#include "JackRequest.h"
......@@ -44,7 +40,7 @@ HANDLE JackClientPipeThread::fMutex = NULL; // never released....
// fRefNum = -1 correspond to already removed client
JackClientPipeThread::JackClientPipeThread(JackWinNamedPipeClient* pipe)
: fPipe(pipe), fServer(NULL), fRefNum(0), fThread(this)
: fPipe(pipe), fServer(NULL), fThread(this), fRefNum(0)
{
if (fMutex == NULL)
fMutex = CreateMutex(NULL, FALSE, NULL);
......@@ -74,7 +70,7 @@ void JackClientPipeThread::Close() // Close the Server/Client connection
jack_log("JackClientPipeThread::Close %x %ld", this, fRefNum);
/*
TODO : solve WIN32 thread Kill issue
This would hang.. since Close will be followed by a delete,
This would hang.. since Close will be followed by a delete,
all ressources will be desallocated at the end.
*/
......@@ -220,7 +216,7 @@ bool JackClientPipeThread::HandleRequest()
res.Write(fPipe);
break;
}
case JackRequest::kPortRename: {
jack_log("JackRequest::kPortRename");
JackPortRenameRequest req;
......@@ -405,9 +401,9 @@ error:
void JackWinNamedPipeServerChannel::Close()
{
/* TODO : solve WIN32 thread Kill issue
This would hang the server... since we are quitting it, its not really problematic,
This would hang the server... since we are quitting it, its not really problematic,
all ressources will be desallocated at the end.
fRequestListenPipe.Close();
fThread.Stop();
*/
......
/*
Copyright (C) 2001-2003 Paul Davis
Copyright (C) 2004-2008 Grame
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#if defined(HAVE_CONFIG_H)
#include "config.h"
#endif
#include "JackServerLaunch.h"
int try_start_server(jack_varargs_t* va, jack_options_t options, jack_status_t* status)
{
return 0;
}
......@@ -169,6 +169,7 @@
<Unit filename="JackWinNamedPipeClientChannel.cpp" />
<Unit filename="JackWinProcessSync.cpp" />
<Unit filename="JackWinSemaphore.cpp" />
<Unit filename="JackWinServerLaunch.cpp" />
<Unit filename="JackWinThread.cpp" />
<Unit filename="JackWinTime.c">
<Option compilerVar="CC" />
......
......@@ -21,10 +21,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include "config.h"
#endif
#ifdef WIN32
#pragma warning (disable : 4786)
#endif
#include "JackDriverLoader.h"
#include "driver_interface.h"
#include "JackPortAudioDriver.h"
......
Supports Markdown
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