Skip to content

Commit 27cfccd

Browse files
committed
zeroMQrr for Matlab now running on windows
1 parent 2db4850 commit 27cfccd

4 files changed

Lines changed: 13 additions & 8 deletions

File tree

Resources/Matlab/compile_matlab_zeroMQrr.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
% 1. find the correct locations of zermoMQ librearies and heaers
44
if strfind(computer,'PCWIN')
55
Codefolder=mfilename('fullpath');
6-
Codefolder=Codefolder(1:(end-length(mfilename()-1)));
7-
libraryName = 'libzmq-v110-mt-3_2_2';
6+
Codefolder=Codefolder(1:(end-length(mfilename()-1)-length('Matlab')-1-1));
7+
libraryName = 'libzmq-v120-mt-4_0_4';
88
if strcmp(computer,'PCWIN64')
9-
libFolder = [Codefolder, '/Resources/windows-libs/ZeroMQ/lib_x64'];
9+
libFolder = [Codefolder, '\windows-libs\ZeroMQ\lib_x64'];
1010
else
11-
libFolder = [Codefolder, '/Resources/windows-libs/ZeroMQ/lib_x86'];
11+
libFolder = [Codefolder, '\windows-libs\ZeroMQ\lib_x86'];
1212
end
13-
headerFolder = [Codefolder, '/Resources/windows-libs/ZeroMQ/include'];
13+
headerFolder = [Codefolder, '\windows-libs\ZeroMQ\include'];
1414
elseif strcmp(computer,'GLNX86') || strcmp(computer,'GLNXA64')
1515
libraryName = 'zmq';
1616
if ~isempty(dir(['/usr/local/lib/lib' libraryName '*']))
530 KB
Binary file not shown.

Resources/Matlab/zeroMQrr.mexw64

29.5 KB
Binary file not shown.

Resources/Matlab/zeroMQrr/zeroMQrr.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
typedef struct {
3131
bool thread_running;
3232
int threadIdleTime;
33+
#ifdef _WIN32
34+
DWORD dwThread;
35+
#endif
3336
} ThreadData;
3437

3538
typedef struct {
@@ -403,12 +406,14 @@ void mexFunction( int nlhs, mxArray* plhs[],
403406
wairForEmptyQueue=false;
404407
}
405408
OutDialogues_mutex.unlock();
406-
do_sleep(ms1);
409+
do_sleep(ms10);
407410
}
408411

409412
//now we build a struct with all replies
410413
OutDialogues_mutex.lock();
411-
lastDialogueFetched=OutDialogues.back().timeRequestAdded;
414+
if(!OutDialogues.empty()){
415+
lastDialogueFetched=OutDialogues.back().timeRequestAdded;
416+
}
412417

413418
mxArray * mxOutStruct = mxCreateStructMatrix(1,OutDialogues.size(),5,dialogueFieldnames);
414419

@@ -434,5 +439,5 @@ void mexFunction( int nlhs, mxArray* plhs[],
434439
OutDialogues_mutex.unlock();
435440

436441
plhs[0] = mxOutStruct;
437-
}
442+
}
438443
}

0 commit comments

Comments
 (0)