forked from KolibriOS/kolibrios
RTL for FP 2.2.0
git-svn-id: svn://kolibrios.org@643 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -5,5 +5,7 @@
|
||||
{$undef os2}
|
||||
{$undef linux}
|
||||
|
||||
{$define EMULATOR}
|
||||
{$undef DISABLE_NO_THREAD_MANAGER}
|
||||
{$undef debug_mt}
|
||||
|
||||
{$define EMULATOR}
|
||||
|
||||
@@ -594,7 +594,7 @@ end;
|
||||
|
||||
{ Sound }
|
||||
|
||||
function kos_speak(notes: Pointer): Boolean; assembler; register;
|
||||
function kos_speaker(notes: Pointer): Boolean; assembler; register;
|
||||
asm
|
||||
pushl %esi
|
||||
pushl %ebx
|
||||
|
||||
@@ -151,6 +151,7 @@ begin
|
||||
FThreadID := BeginThread(TThreadFunc(@KonsoleThreadMain), @Self);
|
||||
if FThreadID <> 0 then
|
||||
{XXX: ¬®¦¥â § ¢¨áãâì}
|
||||
{‚®, â ª ¨ ¥áâì ¢ 2.2.0.}
|
||||
while not FOpened do ThreadSwitch;
|
||||
end;
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ function kos_fileinfo(kosfile: PKosFile): DWord;
|
||||
|
||||
{ Sound }
|
||||
|
||||
function kos_speak(notes: Pointer): Boolean;
|
||||
function kos_speaker(notes: Pointer): Boolean;
|
||||
|
||||
{ Work with hardware }
|
||||
function kos_readport(index: DWord): DWord;
|
||||
|
||||
@@ -185,7 +185,7 @@ begin
|
||||
if not IsMultiThread then
|
||||
begin
|
||||
TLSKey := TLSAlloc();
|
||||
InitThreadVars(@SysRelocateThreadVar); {XXX: must be @SysRelocateThreadvar}
|
||||
InitThreadVars(@SysRelocateThreadVar);
|
||||
IsMultiThread := True;
|
||||
end;
|
||||
|
||||
@@ -287,6 +287,51 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
{*****************************************************************************
|
||||
Heap Mutex Protection
|
||||
*****************************************************************************}
|
||||
|
||||
{$ifndef HAS_MT_MEMORYMANAGER}
|
||||
var
|
||||
HeapMutex: TRTLCriticalSection;
|
||||
|
||||
procedure KosHeapMutexInit;
|
||||
begin
|
||||
InitCriticalSection(HeapMutex);
|
||||
end;
|
||||
|
||||
procedure KosHeapMutexDone;
|
||||
begin
|
||||
DoneCriticalSection(HeapMutex);
|
||||
end;
|
||||
|
||||
procedure KosHeapMutexLock;
|
||||
begin
|
||||
EnterCriticalSection(HeapMutex);
|
||||
end;
|
||||
|
||||
procedure KosHeapMutexUnlock;
|
||||
begin
|
||||
LeaveCriticalSection(HeapMutex);
|
||||
end;
|
||||
|
||||
|
||||
const
|
||||
KosMemoryMutexManager: TMemoryMutexManager = (
|
||||
MutexInit : @KosHeapMutexInit;
|
||||
MutexDone : @KosHeapMutexDone;
|
||||
MutexLock : @KosHeapMutexLock;
|
||||
MutexUnlock: @KosHeapMutexUnlock);
|
||||
|
||||
|
||||
procedure InitHeapMutexes;
|
||||
begin
|
||||
SetMemoryMutexManager(KosMemoryMutexManager);
|
||||
end;
|
||||
|
||||
{$endif HAS_MT_MEMORYMANAGER}
|
||||
|
||||
|
||||
var
|
||||
KosThreadManager: TThreadManager;
|
||||
|
||||
@@ -336,5 +381,8 @@ begin
|
||||
SemaphorePost := @NoSemaphorePost;
|
||||
end;
|
||||
SetThreadManager(KosThreadManager);
|
||||
{$ifndef HAS_MT_MEMORYMANAGER}
|
||||
InitHeapMutexes;
|
||||
{$endif HAS_MT_MEMORYMANAGER}
|
||||
ThreadID := GetCurrentThreadID;
|
||||
end;
|
||||
|
||||
@@ -161,7 +161,7 @@ begin
|
||||
ReleaseFileRecord(Handle);
|
||||
end;
|
||||
|
||||
function FileTruncate(Handle: THandle; Size: Int64): Boolean;
|
||||
function FileTruncate(Handle: THandle; Size: Longint): Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user