Skip to content

Commit fa627ce

Browse files
committed
fix(fpm_compile_commands): Add thread safety (OpenMP critical) to command registration
1 parent fd1b1f8 commit fa627ce

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/fpm_compile_commands.F90

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,21 +287,20 @@ subroutine cct_register(self, command, target_os, error)
287287
file = string_t(source_file))
288288

289289
! Add it to the structure
290-
call cct_register_object(self, cmd, error)
290+
!$omp critical (command_update)
291+
call cct_register_object(self, cmd)
292+
!$omp end critical (command_update)
291293

292294
end subroutine cct_register
293295

294-
pure subroutine cct_register_object(self, command, error)
296+
pure subroutine cct_register_object(self, command)
295297

296298
!> Instance of the serializable object
297299
class(compile_command_table_t), intent(inout) :: self
298300

299301
!> Data structure
300302
type(compile_command_t), intent(in) :: command
301303

302-
!> Error handling
303-
type(error_t), allocatable, intent(out) :: error
304-
305304
if (allocated(self%command)) then
306305
self%command = [self%command, command]
307306
else

0 commit comments

Comments
 (0)