Subversion Repositories shark

Rev

Rev 662 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
221 giacomo 1
//====================================================================================
2
//       FFFFFFIII   RRRRR      SSTTTTTTT
3
//      FF         IIR   RR    SS
4
//     FF           IR        SS
5
//    FFFFFF         RRRR    SSSSST      
6
//   FF       FI       RRR  SS
7
//  FF         II     RRR  SS
8
// FF           IIIIIR    RS 
9
//       
10
// Basic FSF(FIRST Scheduling Framework) contract management
11
// S.Ha.R.K. Implementation
12
//=====================================================================
13
 
14
#include <time.h>
15
#include <sys/boolean.h>
16
#include <sys/types.h>
17
 
18
#include "fsf_configuration_parameters.h"
19
#include "fsf_opaque_types.h"
20
 
224 giacomo 21
#include "edfstar.h"
235 giacomo 22
#include "rmstar.h"
224 giacomo 23
#include "posixstar.h"
334 giacomo 24
#include "mpegstar.h"
224 giacomo 25
 
221 giacomo 26
#ifndef _FSF_CONTRACT_H_
27
#define _FSF_CONTRACT_H_
28
 
404 trimarchi 29
 
30
 
224 giacomo 31
/* S.Ha.R.K. Init */
406 giacomo 32
int FSF_register_module(int server_level, bandwidth_t max_bw);
224 giacomo 33
 
221 giacomo 34
//////////////////////////////////////////////////////////////////
35
//                     BASIC TYPES AND CONSTANTS
36
//////////////////////////////////////////////////////////////////
37
 
38
typedef enum {FSF_BOUNDED, FSF_INDETERMINATE} fsf_workload_t;
39
 
40
typedef enum {FSF_CONTINUOUS, FSF_DISCRETE} fsf_granularity_t;
41
 
42
typedef struct {
43
  struct timespec    budget;    // Execution time
44
  struct timespec    period;    // Period
45
} fsf_utilization_value_t;
46
 
47
typedef struct {
48
  int                         size; // = 0
49
  fsf_utilization_value_t     unit[FSF_MAX_N_UTILIZATION_VALUES];
50
} fsf_utilization_set_t;
51
 
52
typedef unsigned long         fsf_preemption_level_t; // range 1..2**32-1
53
 
54
typedef struct {
55
  struct timespec          wcet;      // Execution time
56
  fsf_preemption_level_t   plevel;    // Preemption_Level, range 1..2**32-1
57
} fsf_critical_section_data_t;
58
 
808 trimarchi 59
 
60
// Definition of basic types
61
 
62
typedef unsigned int  fsf_shared_op_id_t;
63
typedef unsigned int  fsf_shared_obj_id_t;
64
 
65
// Operations
66
// The first field contains the id of the related object
67
// the second field contains an identifier of the operation
68
//   this identifier is unique for the object but needs not to be unique
69
//   for the system. In other words, there can be two operations with the 
70
//   same identifier belonging to different shared objects: they are 
71
//   effectively two distinct operations; two different operations on the 
72
//   same object must have different identifiers
73
 
221 giacomo 74
typedef struct {
808 trimarchi 75
  fsf_shared_obj_id_t      obj_id;    // Object identification
76
  fsf_shared_op_id_t       op_id;     // Operation Identification
77
  struct timespec          wcet;      // Execution time
78
} fsf_shared_operation_t;
79
 
80
// Shared object
81
// the first field is the number of distinct operations on the 
82
//    shared object. It is initialized to 0.
83
// the second field is the id of the object, must be unique in the system.
84
// the third field is a list of shared operations.
85
 
86
 
87
 
88
 
89
typedef struct {
221 giacomo 90
  int                          size; // = 0
91
  fsf_critical_section_data_t  section[FSF_MAX_N_CRITICAL_SECTIONS];
92
} fsf_critical_sections_t;
93
 
808 trimarchi 94
typedef struct {
95
  int                      size;      // = 0
96
  fsf_shared_obj_id_t      obj_id;    // object id
97
  fsf_shared_operation_t   shared_op[FSF_MAX_SHARED_OPERATION];
98
} fsf_shared_object_t;
99
 
100
typedef struct {
101
  int size; // =0
102
  fsf_shared_operation_t       operation[FSF_MAX_SHARED_OPERATION];
103
} fsf_shared_operations_t;
104
 
221 giacomo 105
typedef int fsf_scheduler_id_t;
106
 
107
#define FSF_SCHEDULER_POSIX             0
108
#define FSF_SCHEDULER_EDF               1
109
#define FSF_SCHEDULER_RM                2
334 giacomo 110
#define FSF_SCHEDULER_MPEG              3
221 giacomo 111
 
112
// Constants for assigning default values
113
#define FSF_DEFAULT_WORKLOAD            FSF_INDETERMINATE
114
#define FSF_DEFAULT_GRANULARITY         FSF_CONTINUOUS
115
#define FSF_DEFAULT_QUALITY             0
116
#define FSF_DEFAULT_IMPORTANCE          1
662 giacomo 117
#define FSF_DEFAULT_D_EQUALS_T          TRUE
221 giacomo 118
#define FSF_DEFAULT_DEADLINE            {0,0}
119
#define FSF_DEFAULT_SCHEDULER           FSF_SCHEDULER_POSIX
120
 
121
// Constants for omitting the assignment of values to specific arguments
122
// in calls to initialization functions
123
#define FSF_NULL_CRITICAL_SECTIONS      (fsf_critical_sections_t *)NULL
124
#define FSF_NULL_UTILIZATION_SET        (fsf_utilization_set_t *)NULL
125
#define FSF_NULL_DEADLINE               (struct timespec *)NULL
126
#define FSF_NULL_SIGNAL                 0
127
 
128
 
129
// Error codes
130
#define FSF_ERR_NOT_INITIALIZED                 2003001
131
#define FSF_ERR_TOO_MANY_TASKS                  2003002
132
#define FSF_ERR_ALREADY_INITIALIZED             2003003
133
#define FSF_ERR_BAD_ARGUMENT                    2003004
134
#define FSF_ERR_INVALID_SYNCH_OBJECT_HANDLE     2003005
135
#define FSF_ERR_NO_RENEGOTIATION_REQUESTED      2003006
136
#define FSF_ERR_CONTRACT_REJECTED               2003007
137
#define FSF_ERR_TOO_MANY_SERVERS                2003008
241 giacomo 138
#define FSF_ERR_CREATE_THREAD                   2003009
139
#define FSF_ERR_SERVER_USED                     2003010
140
#define FSF_ERR_INVALID_SERVER                  2003011
141
#define FSF_ERR_CREATE_SERVER                   2003012
221 giacomo 142
 
143
//////////////////////////////////////////////////////////////
144
//                       CONTRACT PARAMETERS
145
//////////////////////////////////////////////////////////////
146
 
147
// Contract parameters type; it is an opaque type
148
typedef FSF_CONTRACT_PARAMETERS_T_OPAQUE fsf_contract_parameters_t;
149
 
150
int
151
fsf_initialize_contract(fsf_contract_parameters_t *contract);
152
 
153
//Description: The operation receives a pointer to a contract parameters
154
//object and initializes it, setting it to the default values.
155
//  budget_min                  => {0,0};                              
156
//  period_max                  => {0,0};                              
157
//  budget_max                  => {0,0};                              
158
//  period_min                  => {0,0};                              
159
//  workload                    => DEFAULT_WORKLOAD;                   
160
 
161
//  d_equals_t                  => DEFAULT_D_EQUALS_T; (false or true)
162
//  deadline                    => DEFAULT_DEADLINE;                     
163
//  budget_overrun_sig_notify   => 0;                  (signal number)
164
//  budget_overrun_sig_value    => {0, NULL};
165
//  deadline_miss_sig_notify    => 0;                  (signal number)
166
//  deadline_miss_sig_value     => {0, NULL};
167
//                                                         
168
//  granularity                 => DEFAULT_GRANULARITY;               
169
//  utilization_set;            => size = 0                         
170
//  quality                     => DEFAULT_QUALITY;     (range 0..100)
171
//  importance                  => DEFAULT_IMPORTANCE;    (range 1..5)
172
//                                                         
173
//  preemption_level            => 0;               (range 1..2**32-1)
174
//  critical_sections;          => size = 0                         
175
 
808 trimarchi 176
 
221 giacomo 177
int
178
fsf_set_contract_basic_parameters
179
  (fsf_contract_parameters_t *contract,
180
   const struct timespec  *budget_min,
181
   const struct timespec  *period_max,
182
   const struct timespec  *budget_max,
183
   const struct timespec  *period_min,
184
   fsf_workload_t          workload);
185
 
186
//Description: The operation updates the specified contract parameters
187
//object by setting its budget, period, and workload to the specified
188
//input parameters. (Note: the workload is a basic parameter because
189
//bounded tasks are triggered by the scheduler (see the Timed Schedule
190
//Next Job operation, later), while indeterminate tasks are not;
191
//therefore, their programming model is quite different).
192
 
193
int
194
fsf_get_contract_basic_parameters
195
  (const fsf_contract_parameters_t *contract,
196
   struct timespec  *budget_min,
197
   struct timespec  *period_max,
198
   struct timespec  *budget_max,
199
   struct timespec  *period_min,
200
   fsf_workload_t   *workload);
201
 
202
//Description: This operation obtains from the specified contract parameters
203
//object its budget, period, and workload, and copies them to the places
204
//pointed to by the corresponding input parameters.
205
 
206
int
207
fsf_set_contract_timing_requirements
208
  (fsf_contract_parameters_t *contract,
209
   bool                   d_equals_t,
210
   const struct timespec *deadline,
211
   int                    budget_overrun_sig_notify,
212
   union sigval           budget_overrun_sig_value,
213
   int                    deadline_miss_sig_notify,
214
   union sigval           deadline_miss_sig_value);
215
 
216
//Description: The operation updates the specified contract parameters
217
//object. d_equals_t is used as a boolean, deadline must be
218
//NULL_DEADLINE if d_equals_t is true, budget_overrun_sig_notify or
219
//deadline_miss_sig_notify may be NULL_SIGNAL (no notification) or any
220
//posix signal. budget_overrun_sig_value and deadline_miss_sig_value
221
//are the values to be delivered with the signal.
222
 
223
int
224
fsf_get_contract_timing_requirements
225
  (const fsf_contract_parameters_t *contract,
226
   bool                            *d_equals_t,
227
   struct timespec                 *deadline,
228
   int                             *budget_overrun_sig_notify,
229
   union sigval                    *budget_overrun_sig_value,
230
   int                             *deadline_miss_sig_notify,
231
   union sigval                    *deadline_miss_sig_value);
232
 
233
//Description: The operation obtains the corresponding input
234
//parameters from the specified contract parameters object. If
235
//d_equals_t is true, the deadline will not be updated.
236
 
237
int  
238
fsf_set_contract_reclamation_parameters
239
  (fsf_contract_parameters_t *contract,
240
   fsf_granularity_t            granularity,
241
   const fsf_utilization_set_t *utilization_set,
242
   int                          quality,
243
   int                          importance);
244
 
245
//Description: The operation updates the specified contract parameters
246
//object by setting its granularity, utilization set, quality, and
247
//importance to the specified input parameters.
248
 
249
int  
250
fsf_get_contract_reclamation_parameters
251
  (const fsf_contract_parameters_t *contract,
252
   fsf_granularity_t               *granularity,
253
   fsf_utilization_set_t           *utilization_set,
254
   int                             *quality,
255
   int                             *importance);
256
 
257
//Description: The operation obtains from the specified contract parameters
258
//object its granularity, utilization set, quality, and importance. Then
259
//copies them to the places pointed to by the specified input parameters.
260
//Only the utilization_values of the utilization_set that are in use, are
261
//copied (according to its size field). 
262
 
808 trimarchi 263
 
264
/* OLD VERSION
221 giacomo 265
int
266
fsf_set_contract_synchronization_parameters
267
  (fsf_contract_parameters_t     *contract,
268
   fsf_preemption_level_t         preemption_level,
269
   const fsf_critical_sections_t *critical_sections);
270
 
271
//Description: The operation updates the specified contract parameters
272
//object by setting its preemption level and critical sections to the
273
//specified input parameters.
274
 
808 trimarchi 275
*/
276
 
221 giacomo 277
int
278
fsf_get_contract_synchronization_parameters
279
  (const fsf_contract_parameters_t *contract,
280
   fsf_preemption_level_t          *preemption_level,
281
   fsf_critical_sections_t         *critical_sections);
282
 
283
//Description: The operation obtains from the specified contract
284
//parameters object its preemption level and critical sections, and
285
//copies them to the places pointed to by the specified input
286
//parameters.  Only those critical_section_data records that are in use
287
//in the critical_sections structure are copied (according to its size
288
//field).
289
 
290
int
291
fsf_set_local_scheduler_parameter
292
  (fsf_contract_parameters_t *contract,
293
   fsf_scheduler_id_t local_scheduler_id);
294
 
241 giacomo 295
//Description: Set the local scheduler
296
 
221 giacomo 297
int
298
fsf_get_local_scheduler_parameter
299
  (const fsf_contract_parameters_t *contract,
300
   fsf_scheduler_id_t *local_scheduler_id);
301
 
241 giacomo 302
//Description: Get the local scheduler
303
 
221 giacomo 304
//////////////////////////////////////////////////////////////
305
//                 SYNCHRONIZATION OBJECTS
306
//////////////////////////////////////////////////////////////
307
 
308
//An abstract synchronization object is defined by the application.
309
//This object can be used by an application to wait for an event to
310
//arrive by invoking the Event Triggered Schedule Next Job operation.
311
//It can also be used to signal the event either causing a waiting
312
//server to wake up, or the event to be queued if no server is waiting
313
//for it.  It is defined by the following opaque type and has the
314
//following operations:
315
 
316
typedef FSF_SYNCH_OBJECT_HANDLE_T_OPAQUE fsf_synch_object_handle_t;
317
 
318
int
319
fsf_create_synchobject(fsf_synch_object_handle_t *synch_handle);
320
 
321
//Description: This operation creates and initializes a
322
//synchronization object variable managed by the scheduler, and
323
//returns a handle to it in the variable pointed to by synch_handle.
324
 
325
int
326
fsf_signal_synchobject(fsf_synch_object_handle_t *synch_handle);
327
 
328
//Description: If one or more servers are waiting upon the specified
329
//synchronization object one of them is awakened; if not, the event is
330
//queued at the synchronization object.
331
 
332
int
333
fsf_destroy_synchobject(fsf_synch_object_handle_t *synch_handle);
334
 
335
//This operation destroys the synchronization object (created by a
336
//previous call to fsf_create_synchobject) that is referenced by the
337
//synch_handle variable. After calling this operation, the
338
//synch_handle variable can not be used until it is initialized again
339
//by a call to fsf_create_synchobject.
340
 
341
 
342
///////////////////////////////////////////////////////////////
343
//                 CONTRACT NEGOCIATION OPERATIONS
344
///////////////////////////////////////////////////////////////
345
 
346
// Server Id type, that identifies a server created to manage a 
347
// given contract
348
 
349
typedef int      fsf_server_id_t;
350
 
404 trimarchi 351
 
352
typedef struct {
407 giacomo 353
        fsf_server_id_t  server;
354
        TIME             actual_period;
355
        TIME             actual_budget;
404 trimarchi 356
        int              Qs;            // quality of service
357
        bandwidth_t      U;     // actual bandwidth
358
        bandwidth_t      Umin;  // min bandwidth
359
        bandwidth_t      Umax;  // max bandwidth
360
        TIME             Cmin;  
417 giacomo 361
        TIME             Tmin;
362
        TIME             Tmax;
661 giacomo 363
        TIME             deadline;
364
        bool             d_equals_t;
404 trimarchi 365
} server_elem;
366
 
367
int recalculate_contract(bandwidth_t U);
368
 
369
 
221 giacomo 370
// The following type references a function that may become 
371
// a thread's code
372
 
373
typedef void * (*fsf_thread_code_t) (void *);
374
 
375
// Negotiate contract functions: The following functions are used to
376
// create servers for a contract parameters specification and also to
377
// assign one or more threads to a server (Note: the current
378
// implementation only supports one thread per server; this limitation
379
// will be removed in the next phase of the project)
380
 
381
// The first time that any of these operations is called, it creates
382
// all the internal management structures that are necessary for the
383
// FIRST Scheduling Framework to operate properly.
384
 
385
int
386
fsf_negotiate_contract
387
  (const fsf_contract_parameters_t *contract,
388
   fsf_server_id_t      *server);
389
 
390
//Description: The operation negotiates a contract for a new
391
//server. If the on-line admission test is enabled it determines
392
//whether the contract can be admitted or not based on the current
393
//contracts established in the system. Then it creates the server and
394
//recalculates all necessary parameters for the contracts already
395
//present in the system. This is a potentially blocking operation; it
396
//returns when the system has either rejected the contract, or
397
//admitted it and made it effective. It returns zero and places the
398
//server identification number in the location pointed to by the
399
//server input parameter if accepted, or an error if rejected.  No
400
//thread is bound to the newly created server, which will be idle
401
//until a thread is bound to it. This operation can only be executed
402
//by threads that are already bound to an active server and therefore
403
//are being scheduled by the fsf scheduler.
404
 
405
int
241 giacomo 406
fsf_create_thread
407
  (fsf_server_id_t    server,
408
   pthread_t         *thread,
409
   pthread_attr_t    *attr,
410
   fsf_thread_code_t  thread_code,
411
   void              *arg,
412
   void              *local_scheduler_arg);
221 giacomo 413
 
241 giacomo 414
//Description: This operation creates a new thread inside a specific
415
//server. The local_scheduler_arg parameter is used to pass specific
416
//parameters to local scheduler. These parameters are application
417
//depented.
221 giacomo 418
 
419
int
420
fsf_get_server
421
  (fsf_server_id_t *server,
422
   pthread_t       thread);
423
 
424
//Description: This operation returns the server associated with a
425
//thread. It returns an error if the thread does not exist, it is not 
426
//under the control of the scheduling framework, or is not bound.
427
 
428
int
429
fsf_cancel_contract (fsf_server_id_t *server);
430
 
431
//Description: The operation eliminates the specified server and
432
//recalculates all necessary parameters for the contracts remaining in 
433
//the system. This is a potentially blocking operation; it returns when 
434
//the system has made the changes effective.
435
 
436
int
437
fsf_renegotiate_contract
438
  (const fsf_contract_parameters_t *new_contract,
439
   fsf_server_id_t server);
440
 
441
//Description: The operation renegotiates a contract for an existing
442
//server. If the on-line admission test is enabled it determines
443
//whether the contract can be admitted or not based on the current
444
//contracts established in the system. If it cannot be admitted, the
445
//old contract remains in effect and an error is returned. If it can
446
//be admitted, it recalculates all necessary parameters for the
447
//contracts already present in the system anr returns zero. This is a
448
//potentially blocking operation; it returns when the system has
449
//either rejected the new contract, or admitted it and made it
450
//effective.
451
 
452
int
453
fsf_request_contract_renegotiation
454
  (const fsf_contract_parameters_t *new_contract,
455
   fsf_server_id_t                  server,
456
   int                              sig_notify,
457
   union sigval                     sig_value);
458
 
459
//Description: The operation enqueues a renegotiate operation for an
460
//existing server, and returns immediately. The renegotiate operation
461
//is performed asynchronously, as soon as it is practical; meanwhile
462
//the system operation will continue normally. When the renegotiation
463
//is made, if the on-line admission test is enabled it determines
464
//whether the contract can be admitted or not based on the current
465
//contracts established in the system. If it cannot be admitted, the
466
//old contract remains in effect. If it can be admitted, it
467
//recalculates all necessary parameters for the contracts already
468
//present in the system. When the operation is completed, notification
469
//is made to the caller, if requested, via a signal. The status of the
470
//operation (in progress, admitted, rejected) can be checked with the
471
//get_renegotiation_status operation.  The argument sig_notify can be
472
//NULL_SIGNAL (no notification), or any posix signal; and in this case
473
//sig_value is to be sent with the signal.
474
 
475
typedef enum {FSF_IN_PROGRESS,
476
              FSF_REJECTED,
477
              FSF_ADMITTED} fsf_renegotiation_status_t;
478
 
479
int
480
fsf_get_renegotiation_status
481
  (fsf_server_id_t server,
482
   fsf_renegotiation_status_t *renegotiation_status);
483
 
484
//Description: The operation reports on the status of the last
485
//renegotiation operation enqueued for the specified server. It is 
486
//callable even after notification of the completion of such operation,
487
//if requested.
488
 
489
int
490
fsf_request_change_quality_and_importance
491
  (fsf_server_id_t server,
492
   int new_importance,
493
   int new_quality);
494
 
495
//Description: The operation enqueues a request to change the quality and 
496
//importance parameters of the specified server, and returns immediately.
497
//The change operation is performed as soon as it is practical;
498
//meanwhile the system operation will continue normally.
499
 
500
 
501
////////////////////////////////////////////////////////////
502
//                  SCHEDULING BOUNDED WORKLOADS
503
////////////////////////////////////////////////////////////
504
 
505
int
506
fsf_schedule_next_timed_job
507
  (const struct timespec *at_absolute_time,
508
   struct timespec       *next_budget,
509
   struct timespec       *next_period,
510
   bool                  *was_deadline_missed,
511
   bool                  *was_budget_overran);
512
 
513
//Description: This operation is invoked by threads associated with
514
//bounded workload servers to indicate that a job has been completed
515
//(and that the scheduler may reassign the unused capacity of the
516
//current job to other servers), and also when the first job require
517
//to be scheduled. The system will activate the job at the specified 
518
//absolute time, and will then use the scheduling rules to determine 
519
//when the job can run, at which time the call returns. Upon return, 
520
//the system reports the current period and budget for the current
521
//job, whether the deadline of the previous job was missed or not, 
522
//and whether the budget of the previous job was overrun or not.
523
 
524
 
525
int
526
fsf_schedule_next_event_triggered_job
527
  (fsf_synch_object_handle_t *synch_handle,
528
   struct timespec           *next_budget,
529
   struct timespec           *next_period,
530
   bool                      *was_deadline_missed,
531
   bool                      *was_budget_overran);
532
 
533
//Description: This operation is invoked by threads associated with
534
//bounded workload servers to indicate that a job has been completed
535
//(and that the scheduler may reassign the unused capacity of the
536
//current job to other servers), and also when the first job require
537
//to be scheduled. If the specified synchronization object has events 
538
//queued, one of them is dequeued; otherwise the server will wait upon 
539
//the specified synchronization object until it is signalled. Then, the 
540
//system will use the scheduling rules to determine when the job can run 
541
//and the call will return at that time. Upon return, the system reports
542
//the current period and budget for the current job, whether the deadline
543
//of the previous job was missed or not, and whether the budget of the
544
//previous job was overrun or not.
545
 
546
 
547
//////////////////////////////////////////////////////////////
548
//           OBTAINING INFORMATION FROM THE SCHEDULER
549
//////////////////////////////////////////////////////////////
550
 
551
int
552
fsf_get_available_capacity (fsf_server_id_t server, float *capacity);
553
 
554
//Description: This operation returns the current spare capacity (in 
555
//percentage of processor or network utilization), currently assigned 
556
//to the importance level of the specified server.
557
 
558
int
559
fsf_get_total_quality (fsf_server_id_t server, int *total_quality);
560
 
561
//Description: This operation returns the sum of the quality parameters 
562
//for all servers in the system of importance level equal to that of 
563
//the specified server.
564
 
565
int
566
fsf_is_admission_test_enabled();
567
 
568
//Description: Returns true if the system is configured with the 
569
//on-line admission test enabled, or false otherwise.
570
 
571
 
808 trimarchi 572
// Mutex function
573
 
574
// Initialization
575
// here we initialize the second and third field of the structure
576
void fsf_init_shared_op(fsf_shared_operation_t     *op,
577
                        fsf_shared_op_id_t  op_id,
578
                        struct timespec     wcet);
579
 
580
// initialization
581
// The shared object id is set equal to the second parameter.
582
void fsf_init_shared_object(fsf_shared_object_t *obj,
583
                            fsf_shared_obj_id_t id);
584
 
585
// Declare an operation
586
// This function is used to declare that a shared object has 
587
//    a synchronized operation on it. 
588
// It checks if another operation with the same id has already been 
589
//    declared; if so, return false (-1).
590
// The obj_id field of the operation is set equal to the shared object id.
591
// the structure op is copied in the first free element in the array 
592
//    shared_op pof the structure obj. If there are no more free element, 
593
//    returns -1.
594
// Returns 0 if the operation has been completed, -1 otherwise.
595
 
596
int fsf_declare_shared_object_operation(fsf_shared_object_t *obj,
597
                                        fsf_shared_operation_t *op);
598
 
599
 
600
int fsf_lock_object(fsf_shared_operation_t *op);
601
 
602
int fsf_unlock_object(fsf_shared_operation_t *op);
603
 
604
// set contract parameters
605
// specify a list of operations for each contract
606
// the list is specified as a pointer to an array.
607
// the size of the array is specified as third parameter
608
// returns 0 if all operations are correctly initialized
609
// returns -1 otherwise.
610
 
611
int fsf_set_contract_synchronization_parameters(
612
    fsf_contract_parameters_t *contract,
613
    const fsf_shared_operation_t *shared_ops,
614
    size_t op_num);
615
 
616
 
617
 
221 giacomo 618
#endif // _FSF_CONTRACT_H_