Mercurial Hosting > luan
comparison src/org/eclipse/jetty/server/Connector.java @ 899:3abf945c33e3
remove _acceptorPriorityOffset
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 07 Oct 2016 00:02:32 -0600 |
parents | 39c12b2306a2 |
children | 6ffa88e38ba9 |
comparison
equal
deleted
inserted
replaced
898:39c12b2306a2 | 899:3abf945c33e3 |
---|---|
61 | 61 |
62 public final Server server; | 62 public final Server server; |
63 private String _host; | 63 private String _host; |
64 public final int port; | 64 public final int port; |
65 private int _acceptors = 1; | 65 private int _acceptors = 1; |
66 private int _acceptorPriorityOffset = 0; | |
67 | 66 |
68 protected int _maxIdleTime = 200000; | 67 protected int _maxIdleTime = 200000; |
69 protected int _lowResourceMaxIdleTime = -1; | 68 protected int _lowResourceMaxIdleTime = -1; |
70 protected int _soLingerTime = -1; | 69 protected int _soLingerTime = -1; |
71 | 70 |
466 | 465 |
467 _acceptorThreads[_acceptor] = current; | 466 _acceptorThreads[_acceptor] = current; |
468 name = _acceptorThreads[_acceptor].getName(); | 467 name = _acceptorThreads[_acceptor].getName(); |
469 current.setName(name + " Acceptor" + _acceptor + " " + Connector.this); | 468 current.setName(name + " Acceptor" + _acceptor + " " + Connector.this); |
470 } | 469 } |
471 int old_priority = current.getPriority(); | |
472 | 470 |
473 try | 471 try |
474 { | 472 { |
475 current.setPriority(old_priority - _acceptorPriorityOffset); | |
476 while (isRunning() && getConnection() != null) | 473 while (isRunning() && getConnection() != null) |
477 { | 474 { |
478 try | 475 try |
479 { | 476 { |
480 accept(_acceptor); | 477 accept(_acceptor); |
498 } | 495 } |
499 } | 496 } |
500 } | 497 } |
501 finally | 498 finally |
502 { | 499 { |
503 current.setPriority(old_priority); | |
504 current.setName(name); | 500 current.setName(name); |
505 | 501 |
506 synchronized (Connector.this) | 502 synchronized (Connector.this) |
507 { | 503 { |
508 if (_acceptorThreads != null) | 504 if (_acceptorThreads != null) |
541 { | 537 { |
542 connection.onClose(); | 538 connection.onClose(); |
543 } | 539 } |
544 | 540 |
545 /* ------------------------------------------------------------ */ | 541 /* ------------------------------------------------------------ */ |
546 /** | |
547 * @return the acceptorPriority | |
548 */ | |
549 public int getAcceptorPriorityOffset() | |
550 { | |
551 return _acceptorPriorityOffset; | |
552 } | |
553 | |
554 /* ------------------------------------------------------------ */ | |
555 /** | |
556 * Set the priority offset of the acceptor threads. The priority is adjusted by this amount (default 0) to either favour the acceptance of new threads and | |
557 * newly active connections or to favour the handling of already dispatched connections. | |
558 * | |
559 * @param offset | |
560 * the amount to alter the priority of the acceptor threads. | |
561 */ | |
562 public void setAcceptorPriorityOffset(int offset) | |
563 { | |
564 _acceptorPriorityOffset = offset; | |
565 } | |
566 | |
567 /* ------------------------------------------------------------ */ | |
568 public final boolean isLowResources() | 542 public final boolean isLowResources() |
569 { | 543 { |
570 return server.isLowOnThreads(); | 544 return server.isLowOnThreads(); |
571 } | 545 } |
572 | 546 |