mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-08 15:52:26 +01:00
Author:halw
Date:2010-04-09T17:11:26.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@551 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
@@ -0,0 +1,3 @@
|
||||
title=es gt reset tools layout 01
|
||||
author=halw
|
||||
path=content/es-gt-reset-tools-layout-01
|
||||
@@ -26,7 +26,7 @@ feature -- Access
|
||||
|
||||
object_per_thread: OBJECT
|
||||
-- Once per thread.
|
||||
once
|
||||
once ("THREAD")
|
||||
create Result.make
|
||||
end
|
||||
|
||||
@@ -34,14 +34,22 @@ feature -- Access
|
||||
-- New 'object' (once per process)
|
||||
-- that could be shared between threads
|
||||
-- without reinitializing it.
|
||||
note
|
||||
once_status: global
|
||||
once
|
||||
once ("PROCESS")
|
||||
create Result.make
|
||||
end
|
||||
|
||||
end -- class TEST_ONCE_PER_PROCESS
|
||||
</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.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user