Access_End

 

Close a critical section.

 

 

Syntax

 

void  Access_End(

          char *str

) ;

 

 

Parameters

 

str

Name of the function that close the critical section.  This string is used in debugging deadlocks.

 

 

Return value

 

This function does not return a value.

 

 

Remarks

 

If you call this function without having first called "Access_Init", the program will write an error message at trace level-1

 

 

Requirements

 

Header:

          sliceO_include.hpp

 

 

Library:

          sliceO_Structures.lib

 

 

 

Example

 

          ...

 

          for ( k=0; k < nb_frame; k++ ) {

 

                    if ( Progress_Abort( progress ) )

                              break ;

                    Progress_Val( progress, k*nb_inc ) ;

 

                    // --- Critical region ---

                    Access_Init( "Threshold_Fct_Thread" ) ;

 

                    SliceO_Frame *frame = frame_list[k] ;

 

                    // --- highlight the frame we are working on ---

                    frame->Flag_Set_On( CLASS_MODE_THIS, window, CLASS_FLAG_HIGHLIGHT_BLU ) ;

                    Fct_Redraw( REDRAW_HIGHLIGHT ) ;

 

                    // --- lock this frame (if not in use!) ---

                    if ( frame->Lock_Get() ) {

                              Access_End( "Threshold_Thread" ) ;

                              Progress_Write( progress, "\xF1\005WARNING:\xF0\002 image locked!" ) ;

                              Progress_Write( progress, "\002   skipping: \001%s", frame->Name_Get() ) ;

                              continue ;

                    }

                    frame->Lock_Set( 1 ) ;

 

                    Progress_Write( progress, "Segmenting: \001%s", frame->Name_Get() ) ;

 

 

                    ...

 

 

                    // --- reset the highlight ----

                    frame->Flag_Set_Off( CLASS_MODE_THIS, window, CLASS_FLAG_HIGHLIGHT_BLU ) ;

                    Fct_Redraw( REDRAW_HIGHLIGHT, window, frame ) ;

 

                    // --- unlock the frame ---

                    frame->Lock_Set( -1 ) ;

 

                    // --- get out of critical region ---

                    Access_End( "Threshold_Fct_Thread" ) ;

          }

 

          ...

 

 

See also

 

Access_Init