note
	description: "Class defining an Eiffel thread."
	legal: "See notice at end of class."
	status: "See notice at end of class."
	date: "$Date: 2018-01-22 11:15:04 +0000 (Mon, 22 Jan 2018) $"
	revision: "$Revision: 101252 $"

deferred class interface
	THREAD

feature -- Access

	thread_id: POINTER
			-- Thread-id of the current thread object.

	terminated: BOOLEAN
			-- True if the thread has terminated.
	
feature -- Basic operations

	execute
			-- Routine executed when thread is launched.

	frozen launch
			-- Initialize a new thread running execute.
			-- Set is_last_launch_successful to True if successful, False otherwise.			
		require
			thread_capable: {PLATFORM}.is_thread_capable
			is_launchable: is_launchable

	frozen launch_with_attributes (attr: THREAD_ATTRIBUTES)
			-- Initialize a new thread running execute, using attributes.
			-- Set is_last_launch_successful to True if successful, False otherwise.
		require
			thread_capable: {PLATFORM}.is_thread_capable
			is_launchable: is_launchable

	exit
			-- Exit calling thread. Must be called from the thread itself.
		require
			is_exit_supported: is_exit_supported
			self: current_thread_id = thread_id

	sleep (nanoseconds: INTEGER_64)
			-- Suspend thread execution for interval specified in
			-- nanoseconds (1 nanosecond = 10^(-9) second).
		require
			self: current_thread_id = thread_id
			non_negative_nanoseconds: nanoseconds >= 0
	
feature -- Status report

	is_exit_supported: BOOLEAN
			-- Can exit be called?
		ensure
			is_class: class

	is_launchable: BOOLEAN
			-- Can we launch a new thread?

	is_last_launch_successful: BOOLEAN
			-- Was the last call to launch or launch_with_attributes in current thread
			-- of execution successful?
	
feature -- Synchronization

	join
			-- The calling thread waits for the current child thread to terminate.

	join_with_timeout (a_timeout_ms: NATURAL_64): BOOLEAN
			-- The calling thread waits for the current child thread to
			-- terminate for at most a_timeout_ms milliseconds.
			-- True if wait terminates within a_timeout_ms, False otherwise.
	
note
	copyright: "Copyright (c) 1984-2018, Eiffel Software and others"
	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
	source: "[
		Eiffel Software
		5949 Hollister Ave., Goleta, CA 93117 USA
		Telephone 805-685-1006, Fax 805-685-6869
		Website http://www.eiffel.com
		Customer support http://support.eiffel.com
	]"

end -- class THREAD

Generated by ISE EiffelStudio