Main method of this thread

The returned valued is passed to the caller of join.

Property definitions

pthreads $ Thread :: main
	# Main method of this thread
	#
	# The returned valued is passed to the caller of `join`.
	fun main: E do return null
lib/pthreads/pthreads.nit:314,2--317,27

actors $ Actor :: main
	redef fun main do
		loop
			var m = mailbox.shift
			if m isa ShutDownMessage then
				sys.active_actors.decrement
				return null
			end
			m.invoke(instance)
		end
	end
lib/actors/actors.nit:43,2--52,4

app $ AsyncHttpRequest :: main
	redef fun main
	do
		var delay = delay
		if delay > 0.0 then delay.sleep

		var uri = uri

		# Execute REST request
		var rep = uri.http_get
		if rep.is_error then
			app.run_on_ui_thread new RestRunnableOnFail(self, rep.error)
			return null
		end

		if deserialize_json then
			# Deserialize
			var deserializer = new JsonDeserializer(rep.value)
			var res = deserializer.deserialize
			if deserializer.errors.not_empty then
				app.run_on_ui_thread new RestRunnableOnFail(self, deserializer.errors.first)
			else
				app.run_on_ui_thread new RestRunnableOnLoad(self, res, rep.code)
			end
		else
			# Return text data
			app.run_on_ui_thread new RestRunnableOnLoad(self, rep.value, rep.code)
			return null
		end

		app.run_on_ui_thread new RestRunnableJoin(self)

		return null
	end
lib/app/http_request.nit:90,2--122,4

android :: http_request $ AsyncHttpRequest :: main
	redef fun main
	do
		var res = super
		jvm.detach_current_thread
		return res
	end
lib/android/http_request.nit:86,2--91,4

libevent $ ServerThread :: main
	redef fun main
	do
		var event_base = new NativeEventBase
		var factory = new TestConnectionFactory(event_base)

		# Bind TCP socket
		factory.bind_tcp(tcp_addr, tcp_port)

		# Bind UNIX domain socket
		factory.bind_unix unix_socket_path

		event_base.dispatch
		event_base.free

		return null
	end
lib/libevent/libevent_test.nit:60,2--75,4

pthreads $ PoolThread :: main
	redef fun main do
		loop
			var t = null
			mutex.lock
			if queue.is_empty then cond.wait(mutex.native.as(not null))
			if not queue.is_empty then
				t = queue.shift
			end
			mutex.unlock
			if t != null then
				t.main
				t.after_main
			end
		end
	end
lib/pthreads/threadpool.nit:64,2--78,4

nitcorn $ ServerThread :: main
	redef fun main
	do
		# Hide testing concept to force nitcorn to actually run
		"NIT_TESTING".setenv("false")

		# Setup
		var vh = new VirtualHost(iface)
		vh.routes.add new Route("rest_path", new MyAction)

		# Launch
		var factory = new HttpFactory.and_libevent
		factory.config.virtual_hosts.add vh
		factory.run

		return null
	end
lib/nitcorn/examples/src/test_restful_annot.nit:34,2--49,4

nitcorn $ ClientParallelThread :: main
	redef fun main
	do
		system "curl -s '{iface}/rest_path/async_service?str=thread_{i}'"
		return null
	end
lib/nitcorn/examples/src/test_restful_annot.nit:57,2--61,4

popcorn $ PopTask :: main
	redef fun main do return null
lib/popcorn/pop_tasks.nit:65,2--30

popcorn $ AppThread :: main
	redef fun main
	do
		# Hide testing concept to force nitcorn to actually run
		"NIT_TESTING".setenv("false")
		app.quiet = true
		app.listen(host, port)
		return null
	end
lib/popcorn/pop_tests.nit:102,2--109,4

popcorn $ ClientThread :: main
	redef fun main do
		test_suite.client_test
		print ""
		return null
	end
lib/popcorn/pop_tests.nit:119,2--123,4

pthreads $ MyThread :: main
	redef fun main
	do
		# Print and add to Array 1000 times
		for i in 1000.times do
			var str = "thread {id}: {i}"
			array.add str
		end

		# Wait at the `barrier`
		barrier.wait

		return id
	end
lib/pthreads/examples/concurrent_array_and_barrier.nit:36,2--48,4

pthreads $ Threadedfoo :: main
	redef fun main do
	end
end

7,2--8,4

pthreads $ Threadedbar :: main
	redef fun main do
	end
end

10,2--11,4

pthreads $ Threadedbaz :: main
	redef fun main do
	end
end

10,2--11,4