https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Functions | Variables
mutex_test.C File Reference

Go to the source code of this file.

Functions

void uexternaldb_ (int *LOP, int *, Real[], Real *, int *, int *)
 

Variables

Real mutex_test_global_thread_counter
 

Function Documentation

◆ uexternaldb_()

void uexternaldb_ ( int LOP,
int ,
Real  [],
Real *  ,
int ,
int  
)

Definition at line 21 of file mutex_test.C.

27{
28 switch (*LOP)
29 {
30 // beginning of the simulation
31 case 0:
32 {
33 MutexInit(2);
34 MutexLock(2);
36 MutexUnlock(2);
37 break;
38 }
39
40 // beginning of the timestep
41 case 1:
42 {
43 for (int i = 0; i < 1000; ++i)
44 {
45 MutexLock(2);
47 MutexUnlock(2);
48 }
49 break;
50 }
51
52 // end of the simulation
53 case 3:
54 {
55 if (get_thread_id_() == 0)
56 Moose::out << "sum = " << mutex_test_global_thread_counter << ".\n";
57 break;
58 }
59 }
60}
void MutexInit(int id)
void MutexUnlock(int id)
void MutexLock(int id)
int get_thread_id_()
Definition AbaqusUtils.C:58
Real mutex_test_global_thread_counter
Definition mutex_test.C:18

Variable Documentation

◆ mutex_test_global_thread_counter

Real mutex_test_global_thread_counter

Definition at line 18 of file mutex_test.C.

Referenced by uexternaldb_().