Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
Lima-camera-andor3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LimaGroup
Lima-camera-andor3
Commits
c8d48fbd
Commit
c8d48fbd
authored
Dec 04, 2015
by
Sebastien Petitdemange
Committed by
Laurent Claustre
Dec 04, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sdk initialization is now MT safe
parent
66280138
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
14 deletions
+38
-14
include/Andor3Camera.h
include/Andor3Camera.h
+1
-1
src/Andor3Camera.cpp
src/Andor3Camera.cpp
+37
-13
No files found.
include/Andor3Camera.h
View file @
c8d48fbd
...
...
@@ -301,7 +301,7 @@ namespace lima
// std::map<TrigMode, int> m_trig_mode_maps;
static
bool
sAndorSDK3Initted
;
static
int
sAndorSDK3InittedCounter
;
bool
m_maximage_size_cb_active
;
Camera
::
SdkFrameDim
m_sdk_frame_dim
;
...
...
src/Andor3Camera.cpp
View file @
c8d48fbd
...
...
@@ -119,7 +119,8 @@ namespace lima {
//---------------------------
//- utility variables
//---------------------------
bool
lima
::
Andor3
::
Camera
::
sAndorSDK3Initted
=
false
;
int
lima
::
Andor3
::
Camera
::
sAndorSDK3InittedCounter
=
0
;
pthread_mutex_t
sdkInitMutex
=
PTHREAD_MUTEX_INITIALIZER
;
//---------------------------
//- utility thread
...
...
@@ -181,20 +182,30 @@ m_maximage_size_cb_active(false)
m_temp_buffer_ctrl_obj
=
new
SoftBufferCtrlObj
();
// Initialisation of the atcore library :
if
(
!
sAndorSDK3Initted
)
{
pthread_mutex_lock
(
&
sdkInitMutex
);
if
(
!
sAndorSDK3InittedCounter
)
{
if
(
m_bitflow_path
!=
""
)
{
setenv
(
"BITFLOW_INSTALL_DIRS"
,
m_bitflow_path
.
c_str
(),
true
);
}
else
{
setenv
(
"BITFLOW_INSTALL_DIRS"
,
"/usr/share/andor-3-sdk"
,
false
);
}
THROW_IF_NOT_SUCCESS
(
AT_InitialiseLibrary
(),
"Library initialization failed, check the bitflow path"
);
THROW_IF_NOT_SUCCESS
(
AT_InitialiseUtilityLibrary
(),
"Library Utility initialization failed, check the bitflow path"
);
try
{
THROW_IF_NOT_SUCCESS
(
AT_InitialiseLibrary
(),
"Library initialization failed, check the bitflow path"
);
THROW_IF_NOT_SUCCESS
(
AT_InitialiseUtilityLibrary
(),
"Library Utility initialization failed, check the bitflow path"
);
}
catch
(...)
{
pthread_mutex_unlock
(
&
sdkInitMutex
);
throw
;
}
++
sAndorSDK3InittedCounter
;
}
pthread_mutex_unlock
(
&
sdkInitMutex
);
// --- Get available cameras and select the choosen one.
AT_64
numCameras
;
...
...
@@ -329,11 +340,24 @@ lima::Andor3::Camera::~Camera()
m_camera_handle
=
AT_HANDLE_UNINITIALISED
;
THROW_IF_NOT_SUCCESS
(
AT_FinaliseUtilityLibrary
(),
"Cannot finalise Andor SDK 3 Utility library"
);
THROW_IF_NOT_SUCCESS
(
AT_FinaliseLibrary
(),
"Cannot finalise Andor SDK 3 library"
);
pthread_mutex_lock
(
&
sdkInitMutex
);
if
(
!--
sAndorSDK3InittedCounter
)
{
try
{
THROW_IF_NOT_SUCCESS
(
AT_FinaliseUtilityLibrary
(),
"Cannot finalise Andor SDK 3 Utility library"
);
THROW_IF_NOT_SUCCESS
(
AT_FinaliseLibrary
(),
"Cannot finalise Andor SDK 3 library"
);
}
catch
(...)
{
pthread_mutex_unlock
(
&
sdkInitMutex
);
throw
;
}
}
pthread_mutex_unlock
(
&
sdkInitMutex
);
delete
m_buffer_ctrl_obj
;
delete
m_temp_buffer_ctrl_obj
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment