~ubuntu-branches/ubuntu/lucid/fpc/lucid-proposed

« back to all changes in this revision

Viewing changes to fpcsrc/packages/libc/src/pthread.inc

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-10-09 23:29:00 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081009232900-553f61m37jkp6upv
Tags: 2.2.2-4
[ Torsten Werner ]
* Update ABI version in fpc-depends automatically.
* Remove empty directories from binary package fpc-source.

[ Mazen Neifer ]
* Removed leading path when calling update-alternatives to remove a Linitian
  error.
* Fixed clean target.
* Improved description of packages. (Closes: #498882)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Function InitializeCriticalSection(var lpCriticalSection: TRTLCriticalSection): Integer;
 
2
 
 
3
var
 
4
  Attr : pthread_mutexattr_t;
 
5
 
 
6
begin
 
7
  Result:=pthread_mutexattr_init(Attr);
 
8
  if Result=0 then 
 
9
    Try
 
10
      Result:=pthread_mutexattr_settype(Attr,PTHREAD_MUTEX_RECURSIVE);
 
11
      if Result=0 then 
 
12
        Result:=pthread_mutex_init(lpCriticalSection, Attr);
 
13
    Finally
 
14
      pthread_mutexattr_destroy(Attr);
 
15
    end;
 
16
end;
 
17
 
 
18
function TryEnterCriticalSection(var lpCriticalSection: TRTLCriticalSection): Boolean;
 
19
begin
 
20
  Result:=EBUSY<>pthread_mutex_trylock(lpCriticalSection);
 
21
end;
 
22
 
 
23
                              
 
 
b'\\ No newline at end of file'