Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
libcdi
Commits
75af7a5a
Commit
75af7a5a
authored
12 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
listInitialize: set mutex type to PTHREAD_MUTEX_RECURSIVE
parent
90d481eb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ChangeLog
+4
-0
4 additions, 0 deletions
ChangeLog
examples/cdi_write_reset.c
+4
-5
4 additions, 5 deletions
examples/cdi_write_reset.c
src/resource_handle.c
+10
-4
10 additions, 4 deletions
src/resource_handle.c
with
18 additions
and
9 deletions
ChangeLog
+
4
−
0
View file @
75af7a5a
...
...
@@ -3,6 +3,10 @@
* Version 1.5.8 released
* using CGRIBEX library version 1.5.5
2012-09-20 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* listInitialize: set mutex type to PTHREAD_MUTEX_RECURSIVE
2012-09-11 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cdfInqContents: make ncid local to varid
...
...
This diff is collapsed.
Click to expand it.
examples/cdi_write_reset.c
+
4
−
5
View file @
75af7a5a
#include
<stdio.h>
#include
"cdi.h"
#define nrun
3
0 // Number of runs
#define nrun
10
0 // Number of runs
#define nlon 12 // Number of longitudes
#define nlat 6 // Number of latitudes
#define nlev 5 // Number of levels
...
...
@@ -85,14 +85,13 @@ int run(int irun)
// Close the output stream
streamClose
(
streamID
);
// Destroy the object
/*
// Destroy the objects
vlistDestroy
(
vlistID
);
taxisDestroy
(
taxisID
);
zaxisDestroy
(
zaxisID1
);
zaxisDestroy
(
zaxisID2
);
gridDestroy
(
gridID
);
*/
return
0
;
}
...
...
@@ -103,7 +102,7 @@ int main(void)
for
(
irun
=
0
;
irun
<
nrun
;
++
irun
)
{
run
(
irun
);
//
cdiReset();
cdiReset
();
}
return
0
;
...
...
This diff is collapsed.
Click to expand it.
src/resource_handle.c
+
10
−
4
View file @
75af7a5a
...
...
@@ -2,6 +2,8 @@
# include "config.h"
#endif
#define _XOPEN_SOURCE 600
/* PTHREAD_MUTEX_RECURSIVE */
#include
<stdlib.h>
#include
<stdio.h>
...
...
@@ -134,7 +136,7 @@ void listDestroy ( void )
for
(
j
=
0
;
j
<
listSizeAllocated
[
i
];
j
++
)
{
listElem
=
listResources
[
i
]
+
j
;
if
(
listElem
->
val
)
if
(
listElem
->
val
)
listElem
->
ops
->
valDestroy
(
listElem
->
val
);
}
free
(
listResources
[
i
]
);
...
...
@@ -163,8 +165,12 @@ static
void
listInitialize
(
void
)
{
#if defined (HAVE_LIBPTHREAD)
pthread_mutexattr_t
ma
;
pthread_mutexattr_init
(
&
ma
);
pthread_mutexattr_settype
(
&
ma
,
PTHREAD_MUTEX_RECURSIVE
);
/* initialize global API mutex lock */
pthread_mutex_init
(
&
listMutex
,
NULL
);
pthread_mutex_init
(
&
listMutex
,
&
ma
);
pthread_mutexattr_destroy
(
&
ma
);
#endif
listNew
();
...
...
@@ -203,8 +209,8 @@ void listSizeExtend()
for
(
i
=
listSizeAllocated
[
nsp
];
i
<
newListSize
;
++
i
)
{
listResources
[
nsp
][
i
].
resH
=
namespaceIdxEncode2
(
nsp
,
i
);
listResources
[
nsp
][
i
].
next
=
listResources
[
nsp
]
+
i
+
1
;
listResources
[
nsp
][
i
].
resH
=
namespaceIdxEncode2
(
nsp
,
i
);
listResources
[
nsp
][
i
].
next
=
listResources
[
nsp
]
+
i
+
1
;
}
listResources
[
nsp
][
newListSize
-
1
].
next
=
freeListHead
[
nsp
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment