Skip to content

Commit f3aac49

Browse files
committed
send job compiles
1 parent 6e0aa67 commit f3aac49

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

src/Modules/Legacy/Matlab/Interface/InterfaceWithMatlab.cc

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -674,11 +674,11 @@ bool InterfaceWithMatlabImpl::send_matlab_job()
674674
std::string mfilename = mfile_.substr(0,mfile_.size()-2); // strip the .m
675675
std::string remotefile = file_transfer_->remote_file(mfilename);
676676
#ifndef USE_MATLAB_ENGINE_LIBRARY
677-
IComPacketHandle packet = new IComPacket;
677+
IComPacketHandle packet(new IComPacket);
678678

679-
if (packet.get_rep() == 0)
679+
if (!packet)
680680
{
681-
error("InterfaceWithMatlab: Could not create packet");
681+
module_->error("InterfaceWithMatlab: Could not create packet");
682682
return(false);
683683
}
684684

@@ -693,26 +693,27 @@ bool InterfaceWithMatlabImpl::send_matlab_job()
693693
thread_info_->dolock();
694694
if (!thread_info_->code_done_)
695695
{
696-
thread_info_->wait_code_done_.wait(thread_info_->lock);
696+
UniqueLock lock(thread_info_->lock_.get());
697+
thread_info_->wait_code_done_.wait(lock);
697698
}
698699
bool success = thread_info_->code_success_;
699700
bool exitcond = thread_info_->exit_;
700701
if (!success)
701702
{
702703
if (exitcond)
703704
{
704-
error("InterfaceWithMatlab: the matlab engine crashed or did not start: "+ thread_info_->code_error_);
705-
error("InterfaceWithMatlab: possible causes are:");
706-
error("(1) matlab code failed in such a way that the engine was no able to catch the error (e.g. failure mex of code)");
707-
error("(2) matlab crashed and the matlab engine detected an end of communication of the matlab process");
708-
error("(3) temparory files could not be created or are corrupted");
709-
error("(4) improper matlab version, use matlab V5 or higher, currently matlab V5-V7 are supported");
705+
module_->error("InterfaceWithMatlab: the matlab engine crashed or did not start: "+ thread_info_->code_error_);
706+
module_->error("InterfaceWithMatlab: possible causes are:");
707+
module_->error("(1) matlab code failed in such a way that the engine was no able to catch the error (e.g. failure mex of code)");
708+
module_->error("(2) matlab crashed and the matlab engine detected an end of communication of the matlab process");
709+
module_->error("(3) temparory files could not be created or are corrupted");
710+
module_->error("(4) improper matlab version, use matlab V5 or higher, currently matlab V5-V7 are supported");
710711
}
711712
else
712713
{
713-
error("InterfaceWithMatlab: matlab code failed: "+thread_info_->code_error_);
714-
error("InterfaceWithMatlab: Detected an error in the Matlab code, the matlab engine is still running and caught the exception");
715-
error("InterfaceWithMatlab: Please check the matlab code in the GUI and try again. The output window in the GUI should contain the reported error message generated by matlab");
714+
module_->error("InterfaceWithMatlab: matlab code failed: "+thread_info_->code_error_);
715+
module_->error("InterfaceWithMatlab: Detected an error in the Matlab code, the matlab engine is still running and caught the exception");
716+
module_->error("InterfaceWithMatlab: Please check the matlab code in the GUI and try again. The output window in the GUI should contain the reported error message generated by matlab");
716717
}
717718
thread_info_->code_done_ = false;
718719
thread_info_->unlock();

0 commit comments

Comments
 (0)