{{newin|[[0.9.0]]|090|type=function}}
Creates or retrieves a named thread channel.
== Function ==
=== Synopsis ===
<source lang="lua">
channel = love.thread.getChannel( name )
</source>
=== Arguments ===
{{param|string|name|The name of the channel you want to create or retrieve.}}
=== Returns ===
{{param|Channel|channel|The Channel object associated with the name.}}
== Examples ==
=== Communication between main/thread ===
<source lang="lua">
-- main
thread		= love.thread.newThread ( "thread.lua" );
thread:start ();
channel		= {};
channel.a	= love.thread.getChannel ( "a" );
channel.b	= love.thread.getChannel ( "b" );
channel.b:push ( "foo" );

function love.update ( dt )
	local v = channel.a:pop ();
	if v then
		print ( tostring ( v ) );
		channel.b:push ( "foo" );
	end
end

-- thread
channel 	= {};
channel.a	= love.thread.getChannel ( "a" );
channel.b	= love.thread.getChannel ( "b" );

while true do
	local v = channel.b:pop ();
	if v then
		print ( tostring ( v ) );
		channel.a:push ( "bar" );
	end
end
</source>

== See Also ==
* [[parent::love.thread]]
* [[Constructs::Channel]]
[[Category:Functions]]
{{#set:Description=Creates or retrieves a named thread channel.}}
== Other Languages ==
{{i18n|love.thread.getChannel}}