Update configure script for C# grade.

Implement thread.yield/2 for the C# grade.

m4/mercury.m4:
    Update the C# compiler check to not try the old aliases for the
    Mono C# compiler; do not try the DotGNU (which is no longer a going
    concern) C# compiler either.

    Update the copyright notice for this file.

library/thread.m:
    Uncomment and correct the C# implementation of thread.yield/2.
This commit is contained in:
Julien Fischer
2018-01-04 01:49:31 -05:00
parent c3a5f538b5
commit 97721a4d3e
2 changed files with 9 additions and 18 deletions

View File

@@ -3,7 +3,7 @@
%---------------------------------------------------------------------------%
% Copyright (C) 2000-2001, 2003-2004, 2006-2008, 2010-2011 The University
% of Melbourne.
% Copyright (C) 2014-2017 The Mercury Team.
% Copyright (C) 2014-2018 The Mercury Team.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%---------------------------------------------------------------------------%
@@ -405,17 +405,15 @@ spawn_native(Goal, Res, !IO) :-
[promise_pure, will_not_call_mercury, thread_safe, tabled_for_io,
may_not_duplicate],
"
// Only available in .NET 4.0.
// System.Threading.Yield();
System.Threading.Thread.Yield();
").
:- pragma foreign_proc("Java",
yield(IO0::di, IO::uo),
yield(_IO0::di, _IO::uo),
[promise_pure, will_not_call_mercury, thread_safe, tabled_for_io,
may_not_duplicate],
"
java.lang.Thread.yield();
IO = IO0;
").
yield(!IO).

View File

@@ -1,5 +1,6 @@
#-----------------------------------------------------------------------------#
# Copyright (C) 1999,2001-2004, 2006-2012 The University of Melbourne.
# Copyright (C) 2013-2018 The Mercury team.
# This file may only be copied under the terms of the GNU General
# Public Licence - see the file COPYING in the Mercury distribution.
#-----------------------------------------------------------------------------#
@@ -256,10 +257,10 @@ MS_AL=`basename "$MS_AL"`
AC_PATH_PROGS([CLI_INTERPRETER], [mono])
# Check for the C# (C sharp) compiler.
# mcs is the Mono C# compiler targetting all runtimes
# dmcs is the Mono C# compiler targeting the 4.0 runtime
# gmcs is the Mono C# compiler targeting the 2.0 runtime (with generics).
# cscc is the DotGNU C# compiler.
# csc is the Microsoft C# compiler.
# mcs is the Mono C# compiler targetting all runtime versions.
# (dmcs and gmcs are older aliases for the Mono C# compiler which we do
# not use.)
AC_CACHE_SAVE
case "$mercury_cv_with_csharp_compiler" in
@@ -272,7 +273,7 @@ case "$mercury_cv_with_csharp_compiler" in
exit 1
;;
"")
CSC_COMPILERS="csc mcs dmcs gmcs cscc"
CSC_COMPILERS="csc mcs"
;;
*)
CSC_COMPILERS="$mercury_cv_with_csharp_compiler"
@@ -385,14 +386,6 @@ case "$CSC" in
CSHARP_COMPILER_TYPE=mono
;;
dmcs*)
CSHARP_COMPILER_TYPE=mono
;;
gmcs*)
CSHARP_COMPILER_TYPE=mono
;;
*)
CSHARP_COMPILER_TYPE=unknown
;;