summaryrefslogtreecommitdiff
path: root/lib/stdlib
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | Fix an inconsistent state in eppAnthony Ramine2013-04-262-1/+5
| | |/ | |/| | | | | | | | | | | | | When entering a new file, epp doesn't properly set #epp.name2 like it does on initialisation, generating a malformed file attribute when it leaves the file.
* | | Rename and document lists:zf/2 as lists:filtermap/2Anthony Ramine2013-04-303-9/+44
|/ / | | | | | | | | | | This function is used all over the place in OTP itself and people sometimes want that functionality, they may as well not reimplement it themselves.
* | fix excessive CPU consumption of timer_serverAliaksey Kandratsenka2013-04-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've found stdlib's timer to burn CPU without good reason. Here's what happens. The problem is that it sleeps in milliseconds but computes time in microseconds. And there is bug in code to compute milliseconds to sleep. It computes microseconds difference between now and nearest timer event and then does _truncating_ division by 1000. So on average it sleeps 500 microseconds _less than needed_. On wakeup its checks do I have timer tick that already occurred? No. Ok how much I need to sleep ? It does that bad computation again and gets 0 milliseconds. So next gen_server timeout happens right away only to find we're still before closest timer tick and to decide to sleep 0 milliseconds again. And again and again. This commit changes division to pick ceiling of ratio rather than floor. So that we always sleep not less then difference between now and closest event time.
* | Merge branch 'siri/doc-fnu-opts/OTP-10901' into maintSiri Hansen2013-04-181-0/+1
|\ \ | | | | | | | | | | | | * siri/doc-fnu-opts/OTP-10901: Add documentation of w, i and e addition to +fnu and +fna switches to erl
| * | Add documentation of w, i and e addition to +fnu and +fna switches to erlSiri Hansen2013-04-171-0/+1
| | | | | | | | | | | | | | | These were documented in the stdlib user's guide, but not in the reference manual for erl. This has now been corrected.
* | | Merge branch 'bjorn/fix-encoding/OTP-11041' into maintBjörn Gustavsson2013-04-173-109/+112
|\ \ \ | |/ / |/| | | | | | | | * bjorn/fix-encoding/OTP-11041: Encode Erlang source files with non-ascii characters in UTF-8
| * | Encode Erlang source files with non-ascii characters in UTF-8Björn Gustavsson2013-04-173-109/+112
| | | | | | | | | | | | | | | | | | To ensure that 'master' compiles when we merge 'maint' to it, regardless of which encoding is default in 'master', all source files with non-ascii characters *must* have the encoding specified.
* | | Merge branch 'jaf/fix-supervisor-multi-restart/OTP-11042' into maintFredrik Gustafsson2013-04-154-8/+171
|\ \ \
| * | | Fix rest_for_one and one_for_all restarting a child not terminatedJames Fish2013-04-044-8/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In rest_for_one and one_for_all supervisors one child dying can cause multiple children to be restarted. Previously if the child that caused the restart is started successfully but another child fails to start, the supervisor would not terminate this child with the other successfully restarted children as no record of the pid was kept. Thus the supervisor would try to start this child again. This could lead to multiples of the same child or if the child is registered cause repeated attempts at starting this child - until the max restart threshold was reached. Now the child that failed to start becomes the restarting child, instead of staying with the same child, for the next restart attempt. This has the following side effects: 1) In one_for_all the new version of the child that original died is terminated before a restart attempt is made. 2) In rest_for_one all succesfully restarted children are not terminated and restarting continues from the child that failed to start.
* | | | Merge branch 'lh/demonitor-flush/OTP-11039' into maintFredrik Gustafsson2013-04-154-28/+8
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | * lh/demonitor-flush/OTP-11039: Use erlang:demonitor(Ref, [flush]) where applicable
| * | | Use erlang:demonitor(Ref, [flush]) where applicableLoïc Hoguin2013-04-054-28/+8
| | | |
* | | | Merge branch 'lh/otp-optims/OTP-11035' into maintFredrik Gustafsson2013-04-111-15/+16
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | * lh/otp-optims/OTP-11035: Use erlang:demonitor's flush option on timeout Don't lookup the node unless required in gen:call/{3,4}
| * | | | Use erlang:demonitor's flush option on timeoutLoïc Hoguin2013-04-011-5/+1
| | | | | | | | | | | | | | | | | | | | It is equivalent to the few lines removed, except more efficient.
| * | | | Don't lookup the node unless required in gen:call/{3,4}Loïc Hoguin2013-04-011-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move some operations that aren't required for the happy path. The operations were small, so they shouldn't show a big difference in benchmarks except for systems with many active gen processes.
* | | | | Merge branch 'sverk/dets_remove_test_otp_9607' into maintSverker Eriksson2013-04-112-84/+10
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sverk/dets_remove_test_otp_9607: stdlib: Fix unstable testcase ets_SUITE:delete_large_named_table stdlib: Remove obsolete testcase dets_SUITE:otp_9607
| * | | | | stdlib: Fix unstable testcase ets_SUITE:delete_large_named_tableSverker Eriksson2013-03-271-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the call trace from this testcase as we cannot guarantee named table to be gone until ets:delete returns anyway.
| * | | | | stdlib: Remove obsolete testcase dets_SUITE:otp_9607Sverker Eriksson2013-03-271-75/+2
| |/ / / /
* | | | | Fixed broken links in sys.htmlFredrik Gustafsson2013-04-051-4/+4
| |/ / / |/| | |
* | | | Merge branch 'sv/stdlib/sys-get-state/OTP-11013' into maintFredrik Gustafsson2013-04-048-13/+273
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sv/stdlib/sys-get-state/OTP-11013: Removed ?line macro add sys:get_state/1,2 and sys:replace_state/2,3 update sys:get_status/2,3 documentation for gen_event
| * | | | Removed ?line macroFredrik Gustafsson2013-04-033-52/+52
| | | | |
| * | | | add sys:get_state/1,2 and sys:replace_state/2,3Steve Vinoski2013-04-028-5/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At Erlang Factory 2013 there was discussion during one of the talks about the sys:get_status functions and how useful they were for debugging. Geoff Cant mentioned it would be very useful if the sys module also provided functions to use while debugging to get just the state of a process and also to be able to replace the state of a process, and many others in the audience appeared to agree. The sys:get_state/1,2 functions return the state of a gen_server, gen_fsm, or gen_event process. The return value varies depending on the process type: process state for a gen_server, state name and state data for a gen_fsm, and handler module, handler id, and handler state for each handler registered in a gen_event process. The sys:replace_state/2,3 functions allow the state of a gen_server, gen_fsm, or gen_event process to be replaced with a new state. These functions take a function argument that updates or replaces the process state; using a function to change the state eliminates the race condition of first reading the state via sys:get_state/1 or sys:get_state/2, using its return value to create a new state, and then replacing the old state with the new state, since during that time the process might have received other calls or messages that could have changed its state. * For a gen_server process, the state replacement function takes the process state as an argument and returns a new state. * For a gen_fsm process, the state replacement function gets a tuple of {StateName, StateData} and returns a similar tuple that specifies a new state name, new state data, or both. * For a gen_event process, the state replacement function is called for each registered event handler. It gets a tuple {Module, Id, HandlerState} and returns a similar tuple that specifies the same Module and Id values but may specify a different value for HandlerState. If the state replacement function crashes or results in an error, the original state of a gen_server or gen_fsm process is maintained; if such a crash occurs for a gen_event process, the original state of the event handler for which the state replacement function was called is maintained, but the states of other event handlers of the same gen_event process may still be updated if no errors or crashes occur while replacing their states. Add documentation for sys:get_state/1,2 and sys:replace_state/2,3. The documentation explicitly notes that the functions are intended for use during debugging. Add new tests for these functions to gen_server_SUITE, gen_fsm_SUITE, and gen_event_SUITE.
| * | | | update sys:get_status/2,3 documentation for gen_eventSteve Vinoski2013-03-291-8/+10
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | Modify the documentation for the sys:get_status/2,3 functions to reflect that they also work on gen_event processes, and add a cross reference for gen_event:format_status/2 to go along with the existing cross references for gen_server and gen_fsm.
* | | | Changed handshake from to_erl to run_erl, on behalf of shell searchFredrik Gustafsson2013-04-041-12/+6
| |/ / |/| |
* | | Document erl_parse:abstract/2Hans Bolinder2013-03-293-3/+36
| | | | | | | | | | | | | | | | | | A bug has been fixed: when given the option {encoding,utf8} a list of floating point numbers (in the correct interval) was mistakenly returned as a string.
* | | Fix a bug in the Erlang scannerHans Bolinder2013-03-282-2/+12
|/ / | | | | | | | | The scanner did not crash when a floating point number was encountered in the input string.
* | Merge branch 'dgud/testcase_fixes' into maintDan Gudmundsson2013-03-262-3/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | * dgud/testcase_fixes: Fix timers mnesia: Decrease test times Add debug printouts wx: Fix failing testcases stdlib: Ignore symlink tests on windows
| * | stdlib: Ignore symlink tests on windowsDan Gudmundsson2013-02-262-3/+3
| | | | | | | | | | | | | | | Symlinks only partially works on windows 7, ignore those tests on windows machines for now
* | | Let escript recognize an encoding comment on the second lineHans Bolinder2013-03-196-2/+48
| | | | | | | | | | | | | | | | | | The manual says that an Emacs directive can be placed on the second line. With this patch that directive is also recognized when selecting encoding of the script.
* | | Fix a test case bugHans Bolinder2013-03-181-8/+8
| | | | | | | | | | | | | | | shell_SUITE: Calling i() did not work because if there are more than 100 processes c:i() will go into pager mode, asking for input.
* | | Fix a test case bugHans Bolinder2013-03-181-5/+8
| | | | | | | | | | | | io_proto_SUITE: node names containing some '-' did not work.
* | | Remove ?line from dets_SUITE.erlHans Bolinder2013-03-181-1929/+1928
| | |
* | | Adjust dets.erl to cope with an evil test caseHans Bolinder2013-03-182-21/+41
| | | | | | | | | | | | | | | | | | | | | The test case deletes a Dets process while it is repairing a file. Another client waiting for the Dets process to reply then kicks in and repairs the file. Apparently the temporary file was still open, resulting in an eacces error on Windows.
* | | Merge branch 'mh/supervisor-doc/OTP-10938' into maintFredrik Gustafsson2013-03-131-6/+0
|\ \ \ | | | | | | | | | | | | | | | | * mh/supervisor-doc/OTP-10938: Delete obsolete note about simple-one-for-one supervisor
| * | | Delete obsolete note about simple-one-for-one supervisorMagnus Henoch2013-03-081-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 47759479146ca11ad81eca0bb3236b265e20601d, simple-one-for-one supervisors _do_ kill their children explicitly on shutdown. That commit also removed this note, but it seems like the merge commit 45b4d5309e0686cc5fa28506de76f75b598bbd95 incorrectly reinstated it.
* | | | Merge branch 'sverk/test-cuddling' into maintSverker Eriksson2013-03-121-8/+12
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | * sverk/test-cuddling: stdlib: Remove race in ets_SUITE:delete_large_tab stdlib: Remove race in ets_SUITE:delete_large_named_table
| * | | stdlib: Remove race in ets_SUITE:delete_large_tabSverker Eriksson2013-02-261-1/+4
| | | |
| * | | stdlib: Remove race in ets_SUITE:delete_large_named_tableSverker Eriksson2013-02-261-7/+8
| | |/ | |/|
* | | Update version numbers for R16B01 developmentBjörn-Egil Dahlberg2013-02-271-1/+1
|/ /
* | Prepare releaseOTP_R16BErlang/OTP2013-02-251-0/+69
|/
* Update copyright yearsBjörn-Egil Dahlberg2013-02-227-7/+7
|
* Correct text according to document reviewsPatrik Nyblom2013-02-221-314/+355
|
* Adapt the Unicode chapter of STDLIB users guide to R16Patrik Nyblom2013-02-221-153/+1091
| | | | | Also extended it with more examples, summaries and other stuff.
* [stdlib] Let the shell turn off echo while skipping lineHans Bolinder2013-02-221-0/+5
| | | | The I/O-server group.erl echoed the skipped line.
* Merge branch 'hb/file_name_type/OTP-10852'Patrik Nyblom2013-02-221-23/+23
|\ | | | | | | | | * hb/file_name_type/OTP-10852: Introduce new type file:name_all()
| * Introduce new type file:name_all()Hans Bolinder2013-02-211-23/+23
| |
* | Merge branch 'pan/unicode_printable_ranges'Patrik Nyblom2013-02-2214-91/+306
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * pan/unicode_printable_ranges: Adapt stdlib tests to ~tp detecting latin1 binaries Update primary bootstrap Make wx debugger use +pc flag when applicable Correct misspelled comments and space at lin ends Make ~tp output latin1 binaries as strings if possible Leave the +pc handling to io and io_lib_pretty Remove newly introduced warning in erlexec.c Make shell_SUITE:otp_10302 use +pc unicode when needed Fix io_proto_SUITE to handle the new io_lib_pretty:print Add testcase for +pc and io:printable_range/0 Make printing of UTF-8 in binaries behave like lists. Document +pc flag and io:printable_range/0 Add usage of and spec for io:printable_range/0 Add +pc {latin1|unicode} switch and io:printable_range/0 Fix some Unicode issues OTP-18084
| * | Adapt stdlib tests to ~tp detecting latin1 binariesPatrik Nyblom2013-02-194-6/+6
| | |
| * | Correct misspelled comments and space at lin endsPatrik Nyblom2013-02-182-14/+15
| | |
| * | Make ~tp output latin1 binaries as strings if possiblePatrik Nyblom2013-02-181-7/+21
| | |
| * | Leave the +pc handling to io and io_lib_prettyPatrik Nyblom2013-02-181-3/+8
| | | | | | | | | | | | | | | This makes the shell output binaries and list as intended by the +pc setting.