https://mooseframework.inl.gov
Loading...
Searching...
No Matches
mutex_test.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10/***************************************************************************************
11** UMAT, FOR ABAQUS/STANDARD INCORPORATING ISOTROPIC ELASTICITY **
12***************************************************************************************/
13
15#include "SMAAspUserUtilities.h"
16#include "MooseError.h"
17
19
20extern "C" void
21uexternaldb_(int * LOP,
22 int * /* LRESTART */,
23 Real /* TIME */[],
24 Real * /* DTIME */,
25 int * /* KSTEP */,
26 int * /* KINC */)
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
void uexternaldb_(int *LOP, int *, Real[], Real *, int *, int *)
Definition mutex_test.C:21