MATLAB: Do I receive a segmentation violation when using a critical section in a structure to interface with MATLAB 7.3 (R2006b)

7.3crashcriticalgetMATLABr2006bsectionsegmentationsetstructureviolationvoid

I use a structure to pass values and interact between MATLAB and C with a critical section in it. I receive a crash whenever I try to pass the critical section to MATLAB through a structure.

Best Answer

The ability to pass a critical section as argument in a structure is not available in MATLAB.
When passing structures that include critical sections, Microsoft's compiler provides debug information and redefines the structure. MATLAB, however, uses the LCC compiler, which does not have the same definition of critical secton.
You may be able to pass the pointer (void *) of the critical section. MATLAB can then pass the pointer back to other functions.
If you want to retrieve some information through the pointer, you need to write GET and SET functions that accept pointers as handles to retrieve specific information from the structure.