/[cvs]/joko/Uni/BSArch/02/bakery.c
ViewVC logotype

Annotation of /joko/Uni/BSArch/02/bakery.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations)
Fri May 26 11:08:12 2006 UTC (18 years, 6 months ago) by joko
Branch: MAIN
Changes since 1.1: +25 -0 lines
File MIME type: text/plain
+ My_InitializeCriticalSection
+ My_DeleteCriticalSection
+ various minor changes (Makefile, MAX_THREADS)

1 joko 1.2
2     #include <stdlib.h>
3     #include "bakery.h"
4    
5     void My_InitializeCriticalSection( MY_LPCRITICAL_SECTION * sec ) {
6    
7     int i;
8    
9     /* Datenstruktur "erzeugen" */
10     *sec = malloc(sizeof(struct _crit_sec));
11    
12     /* Datenstruktur mit "0" initialisieren */
13     for (i = 0; i < MAX_THREADS; i++) {
14     (*sec)->choosing[i] = 0;
15     (*sec)->number[i] = 0;
16     }
17    
18     }
19    
20     void My_DeleteCriticalSection( MY_LPCRITICAL_SECTION sec ) {
21    
22     /* Datenstruktur freigeben */
23     free(sec);
24    
25     }

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed