//go:build windows
// +build windows

package scheduler

import (
	"os/exec"
)

// setProcessGroup is a no-op on Windows (process groups work differently)
func setProcessGroup(cmd *exec.Cmd) {
	// Windows doesn't use Setpgid like Unix
	// Process cleanup is handled differently via job objects or direct process kill
}

// killProcessGroup kills the process on Windows
func killProcessGroup(cmd *exec.Cmd) {
	if cmd != nil && cmd.Process != nil {
		// On Windows, we can only kill the process directly
		_ = cmd.Process.Kill()
	}
}

// isProcessRunning checks if a process is still running on Windows
func isProcessRunning(cmd *exec.Cmd) bool {
	if cmd == nil || cmd.Process == nil {
		return false
	}
	// On Windows, try to get process exit code - if it fails, process is still running
	// A simpler approach: try to open the process handle
	// For now, we just check if Process object exists
	// A more robust implementation would use Windows API
	return true
}
