Skip to content

Commit

Permalink
use lock on comiler, erlc is not reentrant
Browse files Browse the repository at this point in the history
git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@377 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information
Claes Wikstrom committed Apr 9, 2003
1 parent 1a88429 commit 9550a40
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions src/yaws_compile.erl
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,27 @@ comp_opts(GC) ->


compile_file(File, GC, SC) ->
?Debug("Compile ~s~n", [File]),
case file_open(File) of
{ok, Fd} ->
Spec = compile_file(#comp{infile = File,
infd = Fd, gc = GC, sc = SC},
1,
get_line(), init, 0, [], 0),
Spec;
_Err ->
yaws:elog("can't open ~s~n", [File]),
exit(normal)
end.
%% broken erlang comppiler isn't
%% reentrant, can only have one erlanf compiler at a time running
global:trans({yaws, self()},
fun() ->
?Debug("Compile ~s~n", [File]),
case file_open(File) of
{ok, Fd} ->
Spec = compile_file(
#comp{infile = File,
infd = Fd, gc = GC, sc = SC},
1,
get_line(), init, 0, [], 0),
Spec;
_Err ->
yaws:elog("can't open ~s~n", [File]),
exit(normal)
end
end,
[node()], infinity).



compile_file(C, _LineNo, eof, aftererl, NumChars, Ack, Errors) ->
file_close(C#comp.infd),
Expand Down

0 comments on commit 9550a40

Please sign in to comment.