github.com/iDigitalFlame/xmt@v0.5.4/cmd/thread_nix.go (about)

     1  //go:build !windows
     2  // +build !windows
     3  
     4  // Copyright (C) 2020 - 2023 iDigitalFlame
     5  //
     6  // This program is free software: you can redistribute it and/or modify
     7  // it under the terms of the GNU General Public License as published by
     8  // the Free Software Foundation, either version 3 of the License, or
     9  // any later version.
    10  //
    11  // This program is distributed in the hope that it will be useful,
    12  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    13  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14  // GNU General Public License for more details.
    15  //
    16  // You should have received a copy of the GNU General Public License
    17  // along with this program.  If not, see <https://www.gnu.org/licenses/>.
    18  //
    19  
    20  package cmd
    21  
    22  import (
    23  	"context"
    24  
    25  	"github.com/iDigitalFlame/xmt/device"
    26  )
    27  
    28  type thread struct {
    29  	_ [0]func()
    30  }
    31  
    32  func (thread) Pid() uint32 {
    33  	return 0
    34  }
    35  func (thread) Wait() error {
    36  	return device.ErrNoWindows
    37  }
    38  func (thread) Stop() error {
    39  	return device.ErrNoWindows
    40  }
    41  func (thread) Running() bool {
    42  	return false
    43  }
    44  func (thread) Resume() error {
    45  	return device.ErrNoWindows
    46  }
    47  func (thread) Suspend() error {
    48  	return device.ErrNoWindows
    49  }
    50  func (thread) Release() error {
    51  	return nil
    52  }
    53  func (thread) SetSuspended(_ bool) {}
    54  func (thread) Done() <-chan struct{} {
    55  	return nil
    56  }
    57  func (thread) ExitCode() (int32, error) {
    58  	return 0, device.ErrNoWindows
    59  }
    60  func (thread) Handle() (uintptr, error) {
    61  	return 0, device.ErrNoWindows
    62  }
    63  func (thread) Location() (uintptr, error) {
    64  	return 0, device.ErrNoWindows
    65  }
    66  func threadInit(_ context.Context) thread {
    67  	return thread{}
    68  }