Skip to content

thread_id is of type TThreadID in FPC/Lazarus #234

@neurolabusc

Description

@neurolabusc

With FPC the function GetCurrentThreadId() returns type TThreadID, but the current code expects NativeInt.Can you type cast this, or is that not what is intended:

  function  TPythonInputOutput.GetCurrentThreadSlotIdx : Integer;
  var
  {$IFDEF FPC}
  thread_id : TThreadID;
  {$ELSE}
    thread_id : NativeInt;
  {$ENDIF}
    i : Integer;
  begin
    thread_id := GetCurrentThreadId;
    for i := 0 to FLinesPerThread.Count-1 do
      if NativeInt(FLinesPerThread.Objects[i]) = NativeInt(thread_id) then
        begin
          Result := i;
          Exit;
        end;
    Result := FLinesPerThread.AddObject( '', TObject(thread_id) );
  end;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions