mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-08 15:52:26 +01:00
Author:admin
Date:2010-04-12T05:39:31.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@552 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -26,7 +26,7 @@ feature -- Access
|
|||||||
|
|
||||||
object_per_thread: OBJECT
|
object_per_thread: OBJECT
|
||||||
-- Once per thread.
|
-- Once per thread.
|
||||||
once ("THREAD")
|
once
|
||||||
create Result.make
|
create Result.make
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -34,22 +34,14 @@ feature -- Access
|
|||||||
-- New 'object' (once per process)
|
-- New 'object' (once per process)
|
||||||
-- that could be shared between threads
|
-- that could be shared between threads
|
||||||
-- without reinitializing it.
|
-- without reinitializing it.
|
||||||
once ("PROCESS")
|
note
|
||||||
|
once_status: global
|
||||||
|
once
|
||||||
create Result.make
|
create Result.make
|
||||||
end
|
end
|
||||||
|
|
||||||
end -- class TEST_ONCE_PER_PROCESS
|
end -- class TEST_ONCE_PER_PROCESS
|
||||||
</code>
|
</code>
|
||||||
|
|
||||||
Note that if you don't precise any once's key, the default is once per thread. For instance the following once is per thread.
|
|
||||||
<eiffel>
|
|
||||||
object_per_thread: OBJECT
|
|
||||||
-- Once per thread.
|
|
||||||
once
|
|
||||||
create Result.make
|
|
||||||
end
|
|
||||||
</eiffel>
|
|
||||||
|
|
||||||
You can do the same with once procedures.
|
You can do the same with once procedures.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user